{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c766a921-5042-4489-b52b-154adc1159f2",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "29a51e20-9dcd-46f1-9cbd-d79780f6ecfe",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pl.read_csv(\"stock_trades/202207-湘财.xls\", encoding=\"GB18030\", separator=\"\\t\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "62a38445-b73e-4982-aee0-bfa17cd55e17",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(17, 16)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "03a7d5d0-f05e-4311-982f-6ab4206f8d9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.height"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8d730396-77e0-4143-adc7-731f8fed690d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.width"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "dc879211-1e5c-4a56-90ba-f3493034dc47",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.is_empty()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f7bfa6b1-5f76-4cdb-a711-f230ab4158cf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Schema([('发生日期', Int64),\n",
       "        ('证券代码', String),\n",
       "        ('证券名称', String),\n",
       "        ('买卖标志', String),\n",
       "        ('业务名称', String),\n",
       "        ('成交时间', String),\n",
       "        ('成交数量', String),\n",
       "        ('成交价格', Float64),\n",
       "        ('成交金额', Float64),\n",
       "        ('发生金额', Float64),\n",
       "        ('手续费', String),\n",
       "        ('印花税', String),\n",
       "        ('过户费', String),\n",
       "        ('其他费', String),\n",
       "        ('备注', String),\n",
       "        ('币种', String)])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.schema"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ae885b3c-904b-41e8-9721-5459d09e7ddb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['发生日期',\n",
       " '证券代码',\n",
       " '证券名称',\n",
       " '买卖标志',\n",
       " '业务名称',\n",
       " '成交时间',\n",
       " '成交数量',\n",
       " '成交价格',\n",
       " '成交金额',\n",
       " '发生金额',\n",
       " '手续费',\n",
       " '印花税',\n",
       " '过户费',\n",
       " '其他费',\n",
       " '备注',\n",
       " '币种']"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "07e541a0-b623-4341-aaee-70cf74fd8b37",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "list"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "633c3049-d483-46dc-a709-58294414cdf9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "434c1466-9ef7-4cf0-912a-bef900eeba0d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[Int64,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " Float64,\n",
       " Float64,\n",
       " Float64,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "308a9020-2e41-4f8c-863f-2e35c5ff4377",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df.schema.keys()) == df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "0073d7fc-c30b-43cc-a541-3da985b9fcac",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df.schema.values()) == df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "1317a46c-7173-43d0-97bc-637e6294f6d9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (1, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220721</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td><td>4884.0</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (1, 16)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ i64      ┆ str      ┆ str      ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ 20220721 ┆ 600269   ┆ 赣粤高速 ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 股息入账:赣粤高速600269;        ┆ 人民币 │\n",
       "│          ┆          ┆          ┆          ┆   ┆         ┆         ┆ 权益股数:40700;                 ┆        │\n",
       "└──────────┴──────────┴──────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "579f3532-bf72-4ca0-a252-93eea0f0f60f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (1, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220718</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td><td>58018.63</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:18.63实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (1, 16)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ i64      ┆ str      ┆ str      ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ 20220718 ┆ 204007   ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券购回:18.63实际占款天数：7-8 ┆ 人民币 │\n",
       "│          ┆          ┆          ┆          ┆   ┆         ┆         ┆ 88880                           ┆        │\n",
       "└──────────┴──────────┴──────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "f3bd5cd9-ac37-4b22-b68a-40d4ed67d2c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (1, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220718</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:10&quot;</td><td>&quot;-10400.00&quot;</td><td>13.2062</td><td>137344.0</td><td>137184.67</td><td>&quot;21.98&quot;</td><td>&quot;137.35&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (1, 16)\n",
       "┌──────────┬───────────┬──────────┬──────────┬───┬────────┬─────────┬──────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码  ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费 ┆ 其他费  ┆ 备注     ┆ 币种   │\n",
       "│ ---      ┆ ---       ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---     ┆ ---      ┆ ---    │\n",
       "│ i64      ┆ str       ┆ str      ┆ str      ┆   ┆ str    ┆ str     ┆ str      ┆ str    │\n",
       "╞══════════╪═══════════╪══════════╪══════════╪═══╪════════╪═════════╪══════════╪════════╡\n",
       "│ 20220718 ┆ =\"002462\" ┆ 嘉事堂   ┆ 卖出     ┆ … ┆ 1.38   ┆ =\"0.00\" ┆ 证券卖出 ┆ 人民币 │\n",
       "└──────────┴───────────┴──────────┴──────────┴───┴────────┴─────────┴──────────┴────────┘"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "93079edb-c9b9-4741-9af6-a65dbbbacbee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (1, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220707</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;-7580.00&quot;</td><td>2.46</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:357.61实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (1, 16)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ i64      ┆ str      ┆ str      ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ 20220707 ┆ 204007   ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券购回:357.61实际占款天数：7- ┆ 人民币 │\n",
       "│          ┆          ┆          ┆          ┆   ┆         ┆         ┆ 888880                          ┆        │\n",
       "└──────────┴──────────┴──────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "fc828e3b-990b-48f9-9c40-e5a4fa4d2c1a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220718</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td><td>-149955.5</td><td>&quot;23.99&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.51&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td><td>-150044.49</td><td>&quot;24.00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.49&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2, 16)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───┬────────┬─────────┬──────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费 ┆ 其他费  ┆ 备注     ┆ 币种   │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---     ┆ ---      ┆ ---    │\n",
       "│ i64      ┆ str      ┆ str      ┆ str      ┆   ┆ str    ┆ str     ┆ str      ┆ str    │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══╪════════╪═════════╪══════════╪════════╡\n",
       "│ 20220718 ┆ 600408   ┆ 安泰集团 ┆ 买入     ┆ … ┆ 1.51   ┆ =\"0.00\" ┆ 证券买入 ┆ 人民币 │\n",
       "│ 20220718 ┆ 600648   ┆ 外高桥   ┆ 买入     ┆ … ┆ 1.49   ┆ =\"0.00\" ┆ 证券买入 ┆ 人民币 │\n",
       "└──────────┴──────────┴──────────┴──────────┴───┴────────┴─────────┴──────────┴────────┘"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[3:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "4b69f646-eb48-4b7a-8001-b5ad38f5bee1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (17, 3)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th><th>买卖标志</th><th>业务名称</th></tr><tr><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td></tr><tr><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td></tr><tr><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td></tr><tr><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td></tr><tr><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;质押回购拆出&quot;</td></tr><tr><td>&quot;金隅集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td></tr><tr><td>&quot;广日股份&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td></tr><tr><td>&quot;渝农商行&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td></tr><tr><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (17, 3)\n",
       "┌──────────┬──────────┬──────────────┐\n",
       "│ 证券名称 ┆ 买卖标志 ┆ 业务名称     │\n",
       "│ ---      ┆ ---      ┆ ---          │\n",
       "│ str      ┆ str      ┆ str          │\n",
       "╞══════════╪══════════╪══════════════╡\n",
       "│ 赣粤高速 ┆ 卖出     ┆ 股息入账     │\n",
       "│ GC007    ┆ 卖出     ┆ 拆出质押购回 │\n",
       "│ 嘉事堂   ┆ 卖出     ┆ 证券卖出     │\n",
       "│ 安泰集团 ┆ 买入     ┆ 证券买入     │\n",
       "│ 外高桥   ┆ 买入     ┆ 证券买入     │\n",
       "│ …        ┆ …        ┆ …            │\n",
       "│ GC007    ┆ 卖出     ┆ 质押回购拆出 │\n",
       "│ 金隅集团 ┆ 买入     ┆ 证券买入     │\n",
       "│ 广日股份 ┆ 买入     ┆ 证券买入     │\n",
       "│ 渝农商行 ┆ 买入     ┆ 证券买入     │\n",
       "│ GC007    ┆ 卖出     ┆ 拆出质押购回 │\n",
       "└──────────┴──────────┴──────────────┘"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:, 2:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "d9caa7e1-de3a-480c-8306-a3947a242a0e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5, 7)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td></tr><tr><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td></tr><tr><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:10&quot;</td><td>&quot;-10400.00&quot;</td><td>13.2062</td><td>137344.0</td></tr><tr><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td></tr><tr><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5, 7)\n",
       "┌──────────┬──────────┬──────────────┬──────────┬───────────┬──────────┬──────────┐\n",
       "│ 证券名称 ┆ 买卖标志 ┆ 业务名称     ┆ 成交时间 ┆ 成交数量  ┆ 成交价格 ┆ 成交金额 │\n",
       "│ ---      ┆ ---      ┆ ---          ┆ ---      ┆ ---       ┆ ---      ┆ ---      │\n",
       "│ str      ┆ str      ┆ str          ┆ str      ┆ str       ┆ f64      ┆ f64      │\n",
       "╞══════════╪══════════╪══════════════╪══════════╪═══════════╪══════════╪══════════╡\n",
       "│ 赣粤高速 ┆ 卖出     ┆ 股息入账     ┆ 16:00:00 ┆ =\"0.00\"   ┆ 3.6      ┆ 4884.0   │\n",
       "│ GC007    ┆ 卖出     ┆ 拆出质押购回 ┆ 19:03:27 ┆ -580.00   ┆ 1.675    ┆ 58000.0  │\n",
       "│ 嘉事堂   ┆ 卖出     ┆ 证券卖出     ┆ 09:38:10 ┆ -10400.00 ┆ 13.2062  ┆ 137344.0 │\n",
       "│ 安泰集团 ┆ 买入     ┆ 证券买入     ┆ 09:44:52 ┆ 47000.00  ┆ 3.19     ┆ 149930.0 │\n",
       "│ 外高桥   ┆ 买入     ┆ 证券买入     ┆ 09:44:31 ┆ 11900.00  ┆ 12.6066  ┆ 150019.0 │\n",
       "└──────────┴──────────┴──────────────┴──────────┴───────────┴──────────┴──────────┘"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:5, \"证券名称\":\"成交金额\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "65b0d5f6-faad-4b80-aaf9-759dcb9eda63",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(20220721,\n",
       " '600269',\n",
       " '赣粤高速',\n",
       " '卖出',\n",
       " '股息入账',\n",
       " '16:00:00',\n",
       " '=\"0.00\"',\n",
       " 3.6,\n",
       " 4884.0,\n",
       " 4884.0,\n",
       " '=\"0.00\"',\n",
       " '=\"0.00\"',\n",
       " '=\"0.00\"',\n",
       " '=\"0.00\"',\n",
       " '股息入账:赣粤高速600269; 权益股数:40700;',\n",
       " '人民币')"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.row(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "26b27c83-490f-4458-8ccd-a0af0bca4544",
   "metadata": {},
   "outputs": [],
   "source": [
    "r = df.rows()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "b9947fa8-58bf-4de3-a482-b403d024728b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "list"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "9e7fc94e-dc9c-46a8-9d57-b29eb4b02725",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(r[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "f2c134a4-3ae0-4764-a5db-64e0101c41eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "7d6a0d70-ef8c-4bdf-aa05-636660b885c2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(r[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "e9066d1b-18a3-42a5-8dd4-024c500b1b3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "s = df.get_column(\"成交金额\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "a17f8398-93e0-4bf4-a25d-05401bc1e921",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (17,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th></tr><tr><td>str</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td></tr><tr><td>&quot;GC007&quot;</td></tr><tr><td>&quot;嘉事堂&quot;</td></tr><tr><td>&quot;安泰集团&quot;</td></tr><tr><td>&quot;外高桥&quot;</td></tr><tr><td>&hellip;</td></tr><tr><td>&quot;GC007&quot;</td></tr><tr><td>&quot;金隅集团&quot;</td></tr><tr><td>&quot;广日股份&quot;</td></tr><tr><td>&quot;渝农商行&quot;</td></tr><tr><td>&quot;GC007&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (17,)\n",
       "Series: '证券名称' [str]\n",
       "[\n",
       "\t\"赣粤高速\"\n",
       "\t\"GC007\"\n",
       "\t\"嘉事堂\"\n",
       "\t\"安泰集团\"\n",
       "\t\"外高桥\"\n",
       "\t…\n",
       "\t\"GC007\"\n",
       "\t\"金隅集团\"\n",
       "\t\"广日股份\"\n",
       "\t\"渝农商行\"\n",
       "\t\"GC007\"\n",
       "]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_series(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "ed0c429b-f497-48d8-a3cc-14bb55200aaf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (17, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220721</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td><td>4884.0</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td><td>58018.63</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:18.63实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:10&quot;</td><td>&quot;-10400.00&quot;</td><td>13.2062</td><td>137344.0</td><td>137184.67</td><td>&quot;21.98&quot;</td><td>&quot;137.35&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td><td>-149955.5</td><td>&quot;23.99&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.51&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td><td>-150044.49</td><td>&quot;24.00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.49&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>20220711</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;质押回购拆出&quot;</td><td>&quot;09:39:27&quot;</td><td>&quot;580.00&quot;</td><td>1.675</td><td>58000.0</td><td>-58002.9</td><td>&quot;2.90&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券回购购回日:20220718预计利息:18.63参考占款…</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;601992&quot;</td><td>&quot;金隅集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:37:25&quot;</td><td>&quot;54000.00&quot;</td><td>2.59</td><td>139860.0</td><td>-139883.8</td><td>&quot;22.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.42&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;600894&quot;</td><td>&quot;广日股份&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:36:30&quot;</td><td>&quot;21400.00&quot;</td><td>6.54</td><td>139956.0</td><td>-139979.8</td><td>&quot;22.39&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.41&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;601077&quot;</td><td>&quot;渝农商行&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:34:24&quot;</td><td>&quot;38300.00&quot;</td><td>3.65</td><td>139795.0</td><td>-139818.75</td><td>&quot;22.37&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220707</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;-7580.00&quot;</td><td>2.46</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:357.61实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (17, 16)\n",
       "┌──────────┬───────────┬──────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码  ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---      ┆ ---       ┆ ---      ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ i64      ┆ str       ┆ str      ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞══════════╪═══════════╪══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ 20220721 ┆ 600269    ┆ 赣粤高速 ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 股息入账:赣粤高速600269;        ┆ 人民币 │\n",
       "│          ┆           ┆          ┆          ┆   ┆         ┆         ┆ 权益股数:40700;                 ┆        │\n",
       "│ 20220718 ┆ 204007    ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券购回:18.63实际占款天数：7-8 ┆ 人民币 │\n",
       "│          ┆           ┆          ┆          ┆   ┆         ┆         ┆ 88880                           ┆        │\n",
       "│ 20220718 ┆ =\"002462\" ┆ 嘉事堂   ┆ 卖出     ┆ … ┆ 1.38    ┆ =\"0.00\" ┆ 证券卖出                        ┆ 人民币 │\n",
       "│ 20220718 ┆ 600408    ┆ 安泰集团 ┆ 买入     ┆ … ┆ 1.51    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220718 ┆ 600648    ┆ 外高桥   ┆ 买入     ┆ … ┆ 1.49    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ …        ┆ …         ┆ …        ┆ …        ┆ … ┆ …       ┆ …       ┆ …                               ┆ …      │\n",
       "│ 20220711 ┆ 204007    ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券回购购回日:20220718预计利息 ┆ 人民币 │\n",
       "│          ┆           ┆          ┆          ┆   ┆         ┆         ┆ :18.63参考占款…                 ┆        │\n",
       "│ 20220711 ┆ 601992    ┆ 金隅集团 ┆ 买入     ┆ … ┆ 1.42    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220711 ┆ 600894    ┆ 广日股份 ┆ 买入     ┆ … ┆ 1.41    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220711 ┆ 601077    ┆ 渝农商行 ┆ 买入     ┆ … ┆ 1.38    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220707 ┆ 204007    ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券购回:357.61实际占款天数：7- ┆ 人民币 │\n",
       "│          ┆           ┆          ┆          ┆   ┆         ┆         ┆ 888880                          ┆        │\n",
       "└──────────┴───────────┴──────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "515e8cb1-8907-42c6-9a3b-bec5f188bc25",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rows: 17\n",
      "Columns: 16\n",
      "$ 发生日期 <i64> 20220721, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718\n",
      "$ 证券代码 <str> '600269', '204007', '=\"002462\"', '600408', '600648', '600269', '600015', '601992', '600894', '601077'\n",
      "$ 证券名称 <str> '赣粤高速', 'GC007', '嘉事堂', '安泰集团', '外高桥', '赣粤高速', '华夏银行', '金隅集团', '广日股份', '渝农商行'\n",
      "$ 买卖标志 <str> '卖出', '卖出', '卖出', '买入', '买入', '买入', '买入', '卖出', '卖出', '卖出'\n",
      "$ 业务名称 <str> '股息入账', '拆出质押购回', '证券卖出', '证券买入', '证券买入', '证券买入', '证券买入', '证券卖出', '证券卖出', '证券卖出'\n",
      "$ 成交时间 <str> '16:00:00', '19:03:27', '09:38:10', '09:44:52', '09:44:31', '09:43:38', '09:42:51', '09:39:28', '09:39:06', '09:38:30'\n",
      "$ 成交数量 <str> '=\"0.00\"', '-580.00', '-10400.00', '47000.00', '11900.00', '40700.00', '30000.00', '-54000.00', '-21400.00', '-38300.00'\n",
      "$ 成交价格 <f64> 3.6, 1.675, 13.2062, 3.19, 12.6066, 3.69, 5.07, 2.5683, 6.5419, 3.58\n",
      "$ 成交金额 <f64> 4884.0, 58000.0, 137344.0, 149930.0, 150019.0, 150183.0, 152100.0, 138686.0, 139996.0, 137114.0\n",
      "$ 发生金额 <f64> 4884.0, 58018.63, 137184.67, -149955.5, -150044.49, -150208.53, -152125.86, 138523.74, 139832.12, 136953.55\n",
      "$ 手续费  <str> '=\"0.00\"', '=\"0.00\"', '21.98', '23.99', '24.00', '24.03', '24.34', '22.19', '22.40', '21.94'\n",
      "$ 印花税  <str> '=\"0.00\"', '=\"0.00\"', '137.35', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '138.69', '140.02', '137.13'\n",
      "$ 过户费  <str> '=\"0.00\"', '=\"0.00\"', '1.38', '1.51', '1.49', '1.50', '1.52', '1.38', '1.46', '1.38'\n",
      "$ 其他费  <str> '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"'\n",
      "$ 备注   <str> '股息入账:赣粤高速600269; 权益股数:40700;', '融券购回:18.63实际占款天数：7-888880', '证券卖出', '证券买入', '证券买入', '证券买入', '证券买入', '证券卖出', '证券卖出', '证券卖出'\n",
      "$ 币种   <str> '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币'\n",
      "\n"
     ]
    }
   ],
   "source": [
    "df.glimpse()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "ae77090d-64ad-4a29-b7f4-293777b3b5f4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220721</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td><td>4884.0</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td><td>58018.63</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:18.63实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:10&quot;</td><td>&quot;-10400.00&quot;</td><td>13.2062</td><td>137344.0</td><td>137184.67</td><td>&quot;21.98&quot;</td><td>&quot;137.35&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td><td>-149955.5</td><td>&quot;23.99&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.51&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td><td>-150044.49</td><td>&quot;24.00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.49&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5, 16)\n",
       "┌──────────┬───────────┬──────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码  ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---      ┆ ---       ┆ ---      ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ i64      ┆ str       ┆ str      ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞══════════╪═══════════╪══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ 20220721 ┆ 600269    ┆ 赣粤高速 ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 股息入账:赣粤高速600269;        ┆ 人民币 │\n",
       "│          ┆           ┆          ┆          ┆   ┆         ┆         ┆ 权益股数:40700;                 ┆        │\n",
       "│ 20220718 ┆ 204007    ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券购回:18.63实际占款天数：7-8 ┆ 人民币 │\n",
       "│          ┆           ┆          ┆          ┆   ┆         ┆         ┆ 88880                           ┆        │\n",
       "│ 20220718 ┆ =\"002462\" ┆ 嘉事堂   ┆ 卖出     ┆ … ┆ 1.38    ┆ =\"0.00\" ┆ 证券卖出                        ┆ 人民币 │\n",
       "│ 20220718 ┆ 600408    ┆ 安泰集团 ┆ 买入     ┆ … ┆ 1.51    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220718 ┆ 600648    ┆ 外高桥   ┆ 买入     ┆ … ┆ 1.49    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "└──────────┴───────────┴──────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "f956a5cc-a1c0-40c2-9e7e-81b3e7d20ec9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220711</td><td>&quot;600894&quot;</td><td>&quot;广日股份&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:36:30&quot;</td><td>&quot;21400.00&quot;</td><td>6.54</td><td>139956.0</td><td>-139979.8</td><td>&quot;22.39&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.41&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;601077&quot;</td><td>&quot;渝农商行&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:34:24&quot;</td><td>&quot;38300.00&quot;</td><td>3.65</td><td>139795.0</td><td>-139818.75</td><td>&quot;22.37&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220707</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;-7580.00&quot;</td><td>2.46</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:357.61实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3, 16)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ i64      ┆ str      ┆ str      ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ 20220711 ┆ 600894   ┆ 广日股份 ┆ 买入     ┆ … ┆ 1.41    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220711 ┆ 601077   ┆ 渝农商行 ┆ 买入     ┆ … ┆ 1.38    ┆ =\"0.00\" ┆ 证券买入                        ┆ 人民币 │\n",
       "│ 20220707 ┆ 204007   ┆ GC007    ┆ 卖出     ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 融券购回:357.61实际占款天数：7- ┆ 人民币 │\n",
       "│          ┆          ┆          ┆          ┆   ┆         ┆         ┆ 888880                          ┆        │\n",
       "└──────────┴──────────┴──────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "72136e51-574f-4e93-a612-ec996011b076",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220718</td><td>&quot;601992&quot;</td><td>&quot;金隅集团&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:39:28&quot;</td><td>&quot;-54000.00&quot;</td><td>2.5683</td><td>138686.0</td><td>138523.74</td><td>&quot;22.19&quot;</td><td>&quot;138.69&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;601077&quot;</td><td>&quot;渝农商行&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:30&quot;</td><td>&quot;-38300.00&quot;</td><td>3.58</td><td>137114.0</td><td>136953.55</td><td>&quot;21.94&quot;</td><td>&quot;137.13&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:38:16&quot;</td><td>&quot;10400.00&quot;</td><td>13.51</td><td>140504.0</td><td>-140526.48</td><td>&quot;22.48&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.41&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3, 16)\n",
       "┌──────────┬───────────┬──────────┬──────────┬───┬────────┬─────────┬──────────┬────────┐\n",
       "│ 发生日期 ┆ 证券代码  ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费 ┆ 其他费  ┆ 备注     ┆ 币种   │\n",
       "│ ---      ┆ ---       ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---     ┆ ---      ┆ ---    │\n",
       "│ i64      ┆ str       ┆ str      ┆ str      ┆   ┆ str    ┆ str     ┆ str      ┆ str    │\n",
       "╞══════════╪═══════════╪══════════╪══════════╪═══╪════════╪═════════╪══════════╪════════╡\n",
       "│ 20220718 ┆ 601992    ┆ 金隅集团 ┆ 卖出     ┆ … ┆ 1.38   ┆ =\"0.00\" ┆ 证券卖出 ┆ 人民币 │\n",
       "│ 20220718 ┆ 601077    ┆ 渝农商行 ┆ 卖出     ┆ … ┆ 1.38   ┆ =\"0.00\" ┆ 证券卖出 ┆ 人民币 │\n",
       "│ 20220711 ┆ =\"002462\" ┆ 嘉事堂   ┆ 买入     ┆ … ┆ 1.41   ┆ =\"0.00\" ┆ 证券买入 ┆ 人民币 │\n",
       "└──────────┴───────────┴──────────┴──────────┴───┴────────┴─────────┴──────────┴────────┘"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sample(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "1c81e078-7c82-4b83-81ed-042e42a07a99",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (9, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>statistic</th><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>str</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;count&quot;</td><td>17.0</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>17.0</td><td>17.0</td><td>17.0</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td></tr><tr><td>&quot;null_count&quot;</td><td>0.0</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td></tr><tr><td>&quot;mean&quot;</td><td>2.0221e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>5.306059</td><td>160805.352941</td><td>815.642353</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;std&quot;</td><td>4.160387</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>3.974618</td><td>159439.770376</td><td>230047.143813</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;min&quot;</td><td>2.0220707e7</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;买入&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;09:33:37&quot;</td><td>&quot;-10400.00&quot;</td><td>1.675</td><td>4884.0</td><td>-152125.86</td><td>&quot;2.90&quot;</td><td>&quot;137.13&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>&quot;25%&quot;</td><td>2.0220711e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>2.59</td><td>137344.0</td><td>-140526.48</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;50%&quot;</td><td>2.0220718e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>3.65</td><td>139860.0</td><td>-139342.29</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;75%&quot;</td><td>2.0220718e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>6.54</td><td>149930.0</td><td>136953.55</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;max&quot;</td><td>2.0220721e7</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;金隅集团&quot;</td><td>&quot;卖出&quot;</td><td>&quot;质押回购拆出&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>13.51</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (9, 17)\n",
       "┌────────────┬─────────────┬───────────┬──────────┬───┬─────────┬─────────┬─────────────────────────────────┬────────┐\n",
       "│ statistic  ┆ 发生日期    ┆ 证券代码  ┆ 证券名称 ┆ … ┆ 过户费  ┆ 其他费  ┆ 备注                            ┆ 币种   │\n",
       "│ ---        ┆ ---         ┆ ---       ┆ ---      ┆   ┆ ---     ┆ ---     ┆ ---                             ┆ ---    │\n",
       "│ str        ┆ f64         ┆ str       ┆ str      ┆   ┆ str     ┆ str     ┆ str                             ┆ str    │\n",
       "╞════════════╪═════════════╪═══════════╪══════════╪═══╪═════════╪═════════╪═════════════════════════════════╪════════╡\n",
       "│ count      ┆ 17.0        ┆ 17        ┆ 17       ┆ … ┆ 17      ┆ 17      ┆ 17                              ┆ 17     │\n",
       "│ null_count ┆ 0.0         ┆ 0         ┆ 0        ┆ … ┆ 0       ┆ 0       ┆ 0                               ┆ 0      │\n",
       "│ mean       ┆ 2.0221e7    ┆ null      ┆ null     ┆ … ┆ null    ┆ null    ┆ null                            ┆ null   │\n",
       "│ std        ┆ 4.160387    ┆ null      ┆ null     ┆ … ┆ null    ┆ null    ┆ null                            ┆ null   │\n",
       "│ min        ┆ 2.0220707e7 ┆ 204007    ┆ GC007    ┆ … ┆ 1.38    ┆ =\"0.00\" ┆ 股息入账:赣粤高速600269;        ┆ 人民币 │\n",
       "│            ┆             ┆           ┆          ┆   ┆         ┆         ┆ 权益股数:40700;                 ┆        │\n",
       "│ 25%        ┆ 2.0220711e7 ┆ null      ┆ null     ┆ … ┆ null    ┆ null    ┆ null                            ┆ null   │\n",
       "│ 50%        ┆ 2.0220718e7 ┆ null      ┆ null     ┆ … ┆ null    ┆ null    ┆ null                            ┆ null   │\n",
       "│ 75%        ┆ 2.0220718e7 ┆ null      ┆ null     ┆ … ┆ null    ┆ null    ┆ null                            ┆ null   │\n",
       "│ max        ┆ 2.0220721e7 ┆ =\"002462\" ┆ 金隅集团 ┆ … ┆ =\"0.00\" ┆ =\"0.00\" ┆ 证券卖出                        ┆ 人民币 │\n",
       "└────────────┴─────────────┴───────────┴──────────┴───┴─────────┴─────────┴─────────────────────────────────┴────────┘"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "86d702b6-0732-453a-9fb3-6d213606d342",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (1, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (1, 16)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───┬────────┬────────┬──────┬──────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注 ┆ 币种 │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---  ┆ ---  │\n",
       "│ u32      ┆ u32      ┆ u32      ┆ u32      ┆   ┆ u32    ┆ u32    ┆ u32  ┆ u32  │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══╪════════╪════════╪══════╪══════╡\n",
       "│ 0        ┆ 0        ┆ 0        ┆ 0        ┆ … ┆ 0      ┆ 0      ┆ 0    ┆ 0    │\n",
       "└──────────┴──────────┴──────────┴──────────┴───┴────────┴────────┴──────┴──────┘"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.null_count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "188ee343-006a-4c2f-95f8-32b429426e1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>发生日期</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>买卖标志</th>\n",
       "      <th>业务名称</th>\n",
       "      <th>成交时间</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交价格</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>其他费</th>\n",
       "      <th>备注</th>\n",
       "      <th>币种</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20220721</td>\n",
       "      <td>600269</td>\n",
       "      <td>赣粤高速</td>\n",
       "      <td>卖出</td>\n",
       "      <td>股息入账</td>\n",
       "      <td>16:00:00</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>3.6000</td>\n",
       "      <td>4884.0</td>\n",
       "      <td>4884.00</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>股息入账:赣粤高速600269; 权益股数:40700;</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20220718</td>\n",
       "      <td>204007</td>\n",
       "      <td>GC007</td>\n",
       "      <td>卖出</td>\n",
       "      <td>拆出质押购回</td>\n",
       "      <td>19:03:27</td>\n",
       "      <td>-580.00</td>\n",
       "      <td>1.6750</td>\n",
       "      <td>58000.0</td>\n",
       "      <td>58018.63</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>融券购回:18.63实际占款天数：7-888880</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20220718</td>\n",
       "      <td>=\"002462\"</td>\n",
       "      <td>嘉事堂</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:38:10</td>\n",
       "      <td>-10400.00</td>\n",
       "      <td>13.2062</td>\n",
       "      <td>137344.0</td>\n",
       "      <td>137184.67</td>\n",
       "      <td>21.98</td>\n",
       "      <td>137.35</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600408</td>\n",
       "      <td>安泰集团</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:44:52</td>\n",
       "      <td>47000.00</td>\n",
       "      <td>3.1900</td>\n",
       "      <td>149930.0</td>\n",
       "      <td>-149955.50</td>\n",
       "      <td>23.99</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.51</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600648</td>\n",
       "      <td>外高桥</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:44:31</td>\n",
       "      <td>11900.00</td>\n",
       "      <td>12.6066</td>\n",
       "      <td>150019.0</td>\n",
       "      <td>-150044.49</td>\n",
       "      <td>24.00</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.49</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600269</td>\n",
       "      <td>赣粤高速</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:43:38</td>\n",
       "      <td>40700.00</td>\n",
       "      <td>3.6900</td>\n",
       "      <td>150183.0</td>\n",
       "      <td>-150208.53</td>\n",
       "      <td>24.03</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.50</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600015</td>\n",
       "      <td>华夏银行</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:42:51</td>\n",
       "      <td>30000.00</td>\n",
       "      <td>5.0700</td>\n",
       "      <td>152100.0</td>\n",
       "      <td>-152125.86</td>\n",
       "      <td>24.34</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.52</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20220718</td>\n",
       "      <td>601992</td>\n",
       "      <td>金隅集团</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:39:28</td>\n",
       "      <td>-54000.00</td>\n",
       "      <td>2.5683</td>\n",
       "      <td>138686.0</td>\n",
       "      <td>138523.74</td>\n",
       "      <td>22.19</td>\n",
       "      <td>138.69</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600894</td>\n",
       "      <td>广日股份</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:39:06</td>\n",
       "      <td>-21400.00</td>\n",
       "      <td>6.5419</td>\n",
       "      <td>139996.0</td>\n",
       "      <td>139832.12</td>\n",
       "      <td>22.40</td>\n",
       "      <td>140.02</td>\n",
       "      <td>1.46</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20220718</td>\n",
       "      <td>601077</td>\n",
       "      <td>渝农商行</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:38:30</td>\n",
       "      <td>-38300.00</td>\n",
       "      <td>3.5800</td>\n",
       "      <td>137114.0</td>\n",
       "      <td>136953.55</td>\n",
       "      <td>21.94</td>\n",
       "      <td>137.13</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20220711</td>\n",
       "      <td>=\"002462\"</td>\n",
       "      <td>嘉事堂</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:38:16</td>\n",
       "      <td>10400.00</td>\n",
       "      <td>13.5100</td>\n",
       "      <td>140504.0</td>\n",
       "      <td>-140526.48</td>\n",
       "      <td>22.48</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.41</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20220711</td>\n",
       "      <td>=\"000900\"</td>\n",
       "      <td>现代投资</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:33:37</td>\n",
       "      <td>34400.00</td>\n",
       "      <td>4.0500</td>\n",
       "      <td>139320.0</td>\n",
       "      <td>-139342.29</td>\n",
       "      <td>22.29</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.39</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>20220711</td>\n",
       "      <td>204007</td>\n",
       "      <td>GC007</td>\n",
       "      <td>卖出</td>\n",
       "      <td>质押回购拆出</td>\n",
       "      <td>09:39:27</td>\n",
       "      <td>580.00</td>\n",
       "      <td>1.6750</td>\n",
       "      <td>58000.0</td>\n",
       "      <td>-58002.90</td>\n",
       "      <td>2.90</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>融券回购购回日:20220718预计利息:18.63参考占款天数：7-888880</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>20220711</td>\n",
       "      <td>601992</td>\n",
       "      <td>金隅集团</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:37:25</td>\n",
       "      <td>54000.00</td>\n",
       "      <td>2.5900</td>\n",
       "      <td>139860.0</td>\n",
       "      <td>-139883.80</td>\n",
       "      <td>22.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.42</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>20220711</td>\n",
       "      <td>600894</td>\n",
       "      <td>广日股份</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:36:30</td>\n",
       "      <td>21400.00</td>\n",
       "      <td>6.5400</td>\n",
       "      <td>139956.0</td>\n",
       "      <td>-139979.80</td>\n",
       "      <td>22.39</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.41</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>20220711</td>\n",
       "      <td>601077</td>\n",
       "      <td>渝农商行</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:34:24</td>\n",
       "      <td>38300.00</td>\n",
       "      <td>3.6500</td>\n",
       "      <td>139795.0</td>\n",
       "      <td>-139818.75</td>\n",
       "      <td>22.37</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>20220707</td>\n",
       "      <td>204007</td>\n",
       "      <td>GC007</td>\n",
       "      <td>卖出</td>\n",
       "      <td>拆出质押购回</td>\n",
       "      <td>19:17:51</td>\n",
       "      <td>-7580.00</td>\n",
       "      <td>2.4600</td>\n",
       "      <td>758000.0</td>\n",
       "      <td>758357.61</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>融券购回:357.61实际占款天数：7-888880</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        发生日期       证券代码   证券名称 买卖标志    业务名称      成交时间       成交数量     成交价格  \\\n",
       "0   20220721     600269   赣粤高速   卖出    股息入账  16:00:00    =\"0.00\"   3.6000   \n",
       "1   20220718     204007  GC007   卖出  拆出质押购回  19:03:27    -580.00   1.6750   \n",
       "2   20220718  =\"002462\"    嘉事堂   卖出    证券卖出  09:38:10  -10400.00  13.2062   \n",
       "3   20220718     600408   安泰集团   买入    证券买入  09:44:52   47000.00   3.1900   \n",
       "4   20220718     600648    外高桥   买入    证券买入  09:44:31   11900.00  12.6066   \n",
       "5   20220718     600269   赣粤高速   买入    证券买入  09:43:38   40700.00   3.6900   \n",
       "6   20220718     600015   华夏银行   买入    证券买入  09:42:51   30000.00   5.0700   \n",
       "7   20220718     601992   金隅集团   卖出    证券卖出  09:39:28  -54000.00   2.5683   \n",
       "8   20220718     600894   广日股份   卖出    证券卖出  09:39:06  -21400.00   6.5419   \n",
       "9   20220718     601077   渝农商行   卖出    证券卖出  09:38:30  -38300.00   3.5800   \n",
       "10  20220711  =\"002462\"    嘉事堂   买入    证券买入  09:38:16   10400.00  13.5100   \n",
       "11  20220711  =\"000900\"   现代投资   买入    证券买入  09:33:37   34400.00   4.0500   \n",
       "12  20220711     204007  GC007   卖出  质押回购拆出  09:39:27     580.00   1.6750   \n",
       "13  20220711     601992   金隅集团   买入    证券买入  09:37:25   54000.00   2.5900   \n",
       "14  20220711     600894   广日股份   买入    证券买入  09:36:30   21400.00   6.5400   \n",
       "15  20220711     601077   渝农商行   买入    证券买入  09:34:24   38300.00   3.6500   \n",
       "16  20220707     204007  GC007   卖出  拆出质押购回  19:17:51   -7580.00   2.4600   \n",
       "\n",
       "        成交金额       发生金额      手续费      印花税      过户费      其他费  \\\n",
       "0     4884.0    4884.00  =\"0.00\"  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "1    58000.0   58018.63  =\"0.00\"  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "2   137344.0  137184.67    21.98   137.35     1.38  =\"0.00\"   \n",
       "3   149930.0 -149955.50    23.99  =\"0.00\"     1.51  =\"0.00\"   \n",
       "4   150019.0 -150044.49    24.00  =\"0.00\"     1.49  =\"0.00\"   \n",
       "5   150183.0 -150208.53    24.03  =\"0.00\"     1.50  =\"0.00\"   \n",
       "6   152100.0 -152125.86    24.34  =\"0.00\"     1.52  =\"0.00\"   \n",
       "7   138686.0  138523.74    22.19   138.69     1.38  =\"0.00\"   \n",
       "8   139996.0  139832.12    22.40   140.02     1.46  =\"0.00\"   \n",
       "9   137114.0  136953.55    21.94   137.13     1.38  =\"0.00\"   \n",
       "10  140504.0 -140526.48    22.48  =\"0.00\"     1.41  =\"0.00\"   \n",
       "11  139320.0 -139342.29    22.29  =\"0.00\"     1.39  =\"0.00\"   \n",
       "12   58000.0  -58002.90     2.90  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "13  139860.0 -139883.80    22.38  =\"0.00\"     1.42  =\"0.00\"   \n",
       "14  139956.0 -139979.80    22.39  =\"0.00\"     1.41  =\"0.00\"   \n",
       "15  139795.0 -139818.75    22.37  =\"0.00\"     1.38  =\"0.00\"   \n",
       "16  758000.0  758357.61  =\"0.00\"  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "\n",
       "                                           备注   币种  \n",
       "0                股息入账:赣粤高速600269; 权益股数:40700;  人民币  \n",
       "1                   融券购回:18.63实际占款天数：7-888880  人民币  \n",
       "2                                        证券卖出  人民币  \n",
       "3                                        证券买入  人民币  \n",
       "4                                        证券买入  人民币  \n",
       "5                                        证券买入  人民币  \n",
       "6                                        证券买入  人民币  \n",
       "7                                        证券卖出  人民币  \n",
       "8                                        证券卖出  人民币  \n",
       "9                                        证券卖出  人民币  \n",
       "10                                       证券买入  人民币  \n",
       "11                                       证券买入  人民币  \n",
       "12  融券回购购回日:20220718预计利息:18.63参考占款天数：7-888880  人民币  \n",
       "13                                       证券买入  人民币  \n",
       "14                                       证券买入  人民币  \n",
       "15                                       证券买入  人民币  \n",
       "16                 融券购回:357.61实际占款天数：7-888880  人民币  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_pandas()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "9494b25f-c00f-4169-8796-3bff4ef67238",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pyarrow.Table\n",
       "发生日期: int64\n",
       "证券代码: large_string\n",
       "证券名称: large_string\n",
       "买卖标志: large_string\n",
       "业务名称: large_string\n",
       "成交时间: large_string\n",
       "成交数量: large_string\n",
       "成交价格: double\n",
       "成交金额: double\n",
       "发生金额: double\n",
       "手续费: large_string\n",
       "印花税: large_string\n",
       "过户费: large_string\n",
       "其他费: large_string\n",
       "备注: large_string\n",
       "币种: large_string\n",
       "----\n",
       "发生日期: [[20220721,20220718,20220718,20220718,20220718,...,20220711,20220711,20220711,20220711,20220707]]\n",
       "证券代码: [[\"600269\",\"204007\",\"=\"002462\"\",\"600408\",\"600648\",...,\"204007\",\"601992\",\"600894\",\"601077\",\"204007\"]]\n",
       "证券名称: [[\"赣粤高速\",\"GC007\",\"嘉事堂\",\"安泰集团\",\"外高桥\",...,\"GC007\",\"金隅集团\",\"广日股份\",\"渝农商行\",\"GC007\"]]\n",
       "买卖标志: [[\"卖出\",\"卖出\",\"卖出\",\"买入\",\"买入\",...,\"卖出\",\"买入\",\"买入\",\"买入\",\"卖出\"]]\n",
       "业务名称: [[\"股息入账\",\"拆出质押购回\",\"证券卖出\",\"证券买入\",\"证券买入\",...,\"质押回购拆出\",\"证券买入\",\"证券买入\",\"证券买入\",\"拆出质押购回\"]]\n",
       "成交时间: [[\"16:00:00\",\"19:03:27\",\"09:38:10\",\"09:44:52\",\"09:44:31\",...,\"09:39:27\",\"09:37:25\",\"09:36:30\",\"09:34:24\",\"19:17:51\"]]\n",
       "成交数量: [[\"=\"0.00\"\",\"-580.00\",\"-10400.00\",\"47000.00\",\"11900.00\",...,\"580.00\",\"54000.00\",\"21400.00\",\"38300.00\",\"-7580.00\"]]\n",
       "成交价格: [[3.6,1.675,13.2062,3.19,12.6066,...,1.675,2.59,6.54,3.65,2.46]]\n",
       "成交金额: [[4884,58000,137344,149930,150019,...,58000,139860,139956,139795,758000]]\n",
       "发生金额: [[4884,58018.63,137184.67,-149955.5,-150044.49,...,-58002.9,-139883.8,-139979.8,-139818.75,758357.61]]\n",
       "..."
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_arrow()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "1663fe40-3c12-44bc-a40b-d3a3c62a34d5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'发生日期': 20220721,\n",
       "  '证券代码': '600269',\n",
       "  '证券名称': '赣粤高速',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '股息入账',\n",
       "  '成交时间': '16:00:00',\n",
       "  '成交数量': '=\"0.00\"',\n",
       "  '成交价格': 3.6,\n",
       "  '成交金额': 4884.0,\n",
       "  '发生金额': 4884.0,\n",
       "  '手续费': '=\"0.00\"',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '股息入账:赣粤高速600269; 权益股数:40700;',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '204007',\n",
       "  '证券名称': 'GC007',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '拆出质押购回',\n",
       "  '成交时间': '19:03:27',\n",
       "  '成交数量': '-580.00',\n",
       "  '成交价格': 1.675,\n",
       "  '成交金额': 58000.0,\n",
       "  '发生金额': 58018.63,\n",
       "  '手续费': '=\"0.00\"',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '融券购回:18.63实际占款天数：7-888880',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '=\"002462\"',\n",
       "  '证券名称': '嘉事堂',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:38:10',\n",
       "  '成交数量': '-10400.00',\n",
       "  '成交价格': 13.2062,\n",
       "  '成交金额': 137344.0,\n",
       "  '发生金额': 137184.67,\n",
       "  '手续费': '21.98',\n",
       "  '印花税': '137.35',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600408',\n",
       "  '证券名称': '安泰集团',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:44:52',\n",
       "  '成交数量': '47000.00',\n",
       "  '成交价格': 3.19,\n",
       "  '成交金额': 149930.0,\n",
       "  '发生金额': -149955.5,\n",
       "  '手续费': '23.99',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.51',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600648',\n",
       "  '证券名称': '外高桥',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:44:31',\n",
       "  '成交数量': '11900.00',\n",
       "  '成交价格': 12.6066,\n",
       "  '成交金额': 150019.0,\n",
       "  '发生金额': -150044.49,\n",
       "  '手续费': '24.00',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.49',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600269',\n",
       "  '证券名称': '赣粤高速',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:43:38',\n",
       "  '成交数量': '40700.00',\n",
       "  '成交价格': 3.69,\n",
       "  '成交金额': 150183.0,\n",
       "  '发生金额': -150208.53,\n",
       "  '手续费': '24.03',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.50',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600015',\n",
       "  '证券名称': '华夏银行',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:42:51',\n",
       "  '成交数量': '30000.00',\n",
       "  '成交价格': 5.07,\n",
       "  '成交金额': 152100.0,\n",
       "  '发生金额': -152125.86,\n",
       "  '手续费': '24.34',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.52',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '601992',\n",
       "  '证券名称': '金隅集团',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:39:28',\n",
       "  '成交数量': '-54000.00',\n",
       "  '成交价格': 2.5683,\n",
       "  '成交金额': 138686.0,\n",
       "  '发生金额': 138523.74,\n",
       "  '手续费': '22.19',\n",
       "  '印花税': '138.69',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600894',\n",
       "  '证券名称': '广日股份',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:39:06',\n",
       "  '成交数量': '-21400.00',\n",
       "  '成交价格': 6.5419,\n",
       "  '成交金额': 139996.0,\n",
       "  '发生金额': 139832.12,\n",
       "  '手续费': '22.40',\n",
       "  '印花税': '140.02',\n",
       "  '过户费': '1.46',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '601077',\n",
       "  '证券名称': '渝农商行',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:38:30',\n",
       "  '成交数量': '-38300.00',\n",
       "  '成交价格': 3.58,\n",
       "  '成交金额': 137114.0,\n",
       "  '发生金额': 136953.55,\n",
       "  '手续费': '21.94',\n",
       "  '印花税': '137.13',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '=\"002462\"',\n",
       "  '证券名称': '嘉事堂',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:38:16',\n",
       "  '成交数量': '10400.00',\n",
       "  '成交价格': 13.51,\n",
       "  '成交金额': 140504.0,\n",
       "  '发生金额': -140526.48,\n",
       "  '手续费': '22.48',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.41',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '=\"000900\"',\n",
       "  '证券名称': '现代投资',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:33:37',\n",
       "  '成交数量': '34400.00',\n",
       "  '成交价格': 4.05,\n",
       "  '成交金额': 139320.0,\n",
       "  '发生金额': -139342.29,\n",
       "  '手续费': '22.29',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.39',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '204007',\n",
       "  '证券名称': 'GC007',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '质押回购拆出',\n",
       "  '成交时间': '09:39:27',\n",
       "  '成交数量': '580.00',\n",
       "  '成交价格': 1.675,\n",
       "  '成交金额': 58000.0,\n",
       "  '发生金额': -58002.9,\n",
       "  '手续费': '2.90',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '融券回购购回日:20220718预计利息:18.63参考占款天数：7-888880',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '601992',\n",
       "  '证券名称': '金隅集团',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:37:25',\n",
       "  '成交数量': '54000.00',\n",
       "  '成交价格': 2.59,\n",
       "  '成交金额': 139860.0,\n",
       "  '发生金额': -139883.8,\n",
       "  '手续费': '22.38',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.42',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '600894',\n",
       "  '证券名称': '广日股份',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:36:30',\n",
       "  '成交数量': '21400.00',\n",
       "  '成交价格': 6.54,\n",
       "  '成交金额': 139956.0,\n",
       "  '发生金额': -139979.8,\n",
       "  '手续费': '22.39',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.41',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '601077',\n",
       "  '证券名称': '渝农商行',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:34:24',\n",
       "  '成交数量': '38300.00',\n",
       "  '成交价格': 3.65,\n",
       "  '成交金额': 139795.0,\n",
       "  '发生金额': -139818.75,\n",
       "  '手续费': '22.37',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220707,\n",
       "  '证券代码': '204007',\n",
       "  '证券名称': 'GC007',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '拆出质押购回',\n",
       "  '成交时间': '19:17:51',\n",
       "  '成交数量': '-7580.00',\n",
       "  '成交价格': 2.46,\n",
       "  '成交金额': 758000.0,\n",
       "  '发生金额': 758357.61,\n",
       "  '手续费': '=\"0.00\"',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '融券购回:357.61实际占款天数：7-888880',\n",
       "  '币种': '人民币'}]"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_dicts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "f2135f91-cc7f-43ec-8610-8c2c2f679b60",
   "metadata": {},
   "outputs": [],
   "source": [
    "s = df.to_series()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "aa6cbaf6-90e9-46b8-a031-b4806566ff5e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'发生日期'"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "e82bdfc1-3cd2-4dfe-96e6-bd870cb19403",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Int64"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.dtype"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "dab590ed-6058-47fc-b1b5-91d97120a975",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(17,)"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "343924c8-5d8e-4c36-84a1-283c604293c3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.len()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "507cbc32-e43a-4eb8-abbe-945a064a604d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th></tr><tr><td>i64</td></tr></thead><tbody><tr><td>20220721</td></tr><tr><td>20220718</td></tr><tr><td>20220718</td></tr><tr><td>20220718</td></tr><tr><td>20220718</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5,)\n",
       "Series: '发生日期' [i64]\n",
       "[\n",
       "\t20220721\n",
       "\t20220718\n",
       "\t20220718\n",
       "\t20220718\n",
       "\t20220718\n",
       "]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "e0e7b5c7-b686-4681-af39-7a59d4f22552",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th></tr><tr><td>i64</td></tr></thead><tbody><tr><td>20220721</td></tr><tr><td>20220718</td></tr><tr><td>20220718</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3,)\n",
       "Series: '发生日期' [i64]\n",
       "[\n",
       "\t20220721\n",
       "\t20220718\n",
       "\t20220718\n",
       "]"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[0, 5, 8]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "e3e14f3f-c4c5-4249-8415-76ef7867f088",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>业务名称</th></tr><tr><td>str</td></tr></thead><tbody><tr><td>&quot;证券卖出&quot;</td></tr><tr><td>&quot;质押回购拆出&quot;</td></tr><tr><td>&quot;证券买入&quot;</td></tr><tr><td>&quot;拆出质押购回&quot;</td></tr><tr><td>&quot;股息入账&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5,)\n",
       "Series: '业务名称' [str]\n",
       "[\n",
       "\t\"证券卖出\"\n",
       "\t\"质押回购拆出\"\n",
       "\t\"证券买入\"\n",
       "\t\"拆出质押购回\"\n",
       "\t\"股息入账\"\n",
       "]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_series(4).unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "96c18c61-6d26-4545-9ccb-6160901fed6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (16, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>成交金额</th><th>count</th></tr><tr><td>f64</td><td>u32</td></tr></thead><tbody><tr><td>58000.0</td><td>2</td></tr><tr><td>137114.0</td><td>1</td></tr><tr><td>758000.0</td><td>1</td></tr><tr><td>138686.0</td><td>1</td></tr><tr><td>139860.0</td><td>1</td></tr><tr><td>&hellip;</td><td>&hellip;</td></tr><tr><td>140504.0</td><td>1</td></tr><tr><td>139320.0</td><td>1</td></tr><tr><td>137344.0</td><td>1</td></tr><tr><td>139956.0</td><td>1</td></tr><tr><td>152100.0</td><td>1</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (16, 2)\n",
       "┌──────────┬───────┐\n",
       "│ 成交金额 ┆ count │\n",
       "│ ---      ┆ ---   │\n",
       "│ f64      ┆ u32   │\n",
       "╞══════════╪═══════╡\n",
       "│ 58000.0  ┆ 2     │\n",
       "│ 137114.0 ┆ 1     │\n",
       "│ 758000.0 ┆ 1     │\n",
       "│ 138686.0 ┆ 1     │\n",
       "│ 139860.0 ┆ 1     │\n",
       "│ …        ┆ …     │\n",
       "│ 140504.0 ┆ 1     │\n",
       "│ 139320.0 ┆ 1     │\n",
       "│ 137344.0 ┆ 1     │\n",
       "│ 139956.0 ┆ 1     │\n",
       "│ 152100.0 ┆ 1     │\n",
       "└──────────┴───────┘"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_series(8).value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "50975213-abbb-4b87-9ad3-1084a91d5689",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (9, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>statistic</th><th>value</th></tr><tr><td>str</td><td>f64</td></tr></thead><tbody><tr><td>&quot;count&quot;</td><td>17.0</td></tr><tr><td>&quot;null_count&quot;</td><td>0.0</td></tr><tr><td>&quot;mean&quot;</td><td>815.642353</td></tr><tr><td>&quot;std&quot;</td><td>230047.143813</td></tr><tr><td>&quot;min&quot;</td><td>-152125.86</td></tr><tr><td>&quot;25%&quot;</td><td>-140526.48</td></tr><tr><td>&quot;50%&quot;</td><td>-139342.29</td></tr><tr><td>&quot;75%&quot;</td><td>136953.55</td></tr><tr><td>&quot;max&quot;</td><td>758357.61</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (9, 2)\n",
       "┌────────────┬───────────────┐\n",
       "│ statistic  ┆ value         │\n",
       "│ ---        ┆ ---           │\n",
       "│ str        ┆ f64           │\n",
       "╞════════════╪═══════════════╡\n",
       "│ count      ┆ 17.0          │\n",
       "│ null_count ┆ 0.0           │\n",
       "│ mean       ┆ 815.642353    │\n",
       "│ std        ┆ 230047.143813 │\n",
       "│ min        ┆ -152125.86    │\n",
       "│ 25%        ┆ -140526.48    │\n",
       "│ 50%        ┆ -139342.29    │\n",
       "│ 75%        ┆ 136953.55     │\n",
       "│ max        ┆ 758357.61     │\n",
       "└────────────┴───────────────┘"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:, \"发生金额\"].describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "bc479b3b-1863-4d32-af76-a288589aae04",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[4884.0,\n",
       " 58018.63,\n",
       " 137184.67,\n",
       " -149955.5,\n",
       " -150044.49,\n",
       " -150208.53,\n",
       " -152125.86,\n",
       " 138523.74,\n",
       " 139832.12,\n",
       " 136953.55,\n",
       " -140526.48,\n",
       " -139342.29,\n",
       " -58002.9,\n",
       " -139883.8,\n",
       " -139979.8,\n",
       " -139818.75,\n",
       " 758357.61]"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:, \"发生金额\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "7ecc5e57-4792-4fe4-8727-3846419f96ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (4, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>count</th></tr><tr><td>i64</td><td>u32</td></tr></thead><tbody><tr><td>20220721</td><td>1</td></tr><tr><td>20220718</td><td>9</td></tr><tr><td>20220707</td><td>1</td></tr><tr><td>20220711</td><td>6</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (4, 2)\n",
       "┌──────────┬───────┐\n",
       "│ 发生日期 ┆ count │\n",
       "│ ---      ┆ ---   │\n",
       "│ i64      ┆ u32   │\n",
       "╞══════════╪═══════╡\n",
       "│ 20220721 ┆ 1     │\n",
       "│ 20220718 ┆ 9     │\n",
       "│ 20220707 ┆ 1     │\n",
       "│ 20220711 ┆ 6     │\n",
       "└──────────┴───────┘"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "7358ea89-301f-416c-9a2c-ab18a45a6485",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (4,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th></tr><tr><td>i64</td></tr></thead><tbody><tr><td>20220707</td></tr><tr><td>20220711</td></tr><tr><td>20220718</td></tr><tr><td>20220721</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (4,)\n",
       "Series: '发生日期' [i64]\n",
       "[\n",
       "\t20220707\n",
       "\t20220711\n",
       "\t20220718\n",
       "\t20220721\n",
       "]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "1791b934-d914-4820-a757-d162930b3a45",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (9, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>statistic</th><th>value</th></tr><tr><td>str</td><td>f64</td></tr></thead><tbody><tr><td>&quot;count&quot;</td><td>17.0</td></tr><tr><td>&quot;null_count&quot;</td><td>0.0</td></tr><tr><td>&quot;mean&quot;</td><td>2.0221e7</td></tr><tr><td>&quot;std&quot;</td><td>4.160387</td></tr><tr><td>&quot;min&quot;</td><td>2.0220707e7</td></tr><tr><td>&quot;25%&quot;</td><td>2.0220711e7</td></tr><tr><td>&quot;50%&quot;</td><td>2.0220718e7</td></tr><tr><td>&quot;75%&quot;</td><td>2.0220718e7</td></tr><tr><td>&quot;max&quot;</td><td>2.0220721e7</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (9, 2)\n",
       "┌────────────┬─────────────┐\n",
       "│ statistic  ┆ value       │\n",
       "│ ---        ┆ ---         │\n",
       "│ str        ┆ f64         │\n",
       "╞════════════╪═════════════╡\n",
       "│ count      ┆ 17.0        │\n",
       "│ null_count ┆ 0.0         │\n",
       "│ mean       ┆ 2.0221e7    │\n",
       "│ std        ┆ 4.160387    │\n",
       "│ min        ┆ 2.0220707e7 │\n",
       "│ 25%        ┆ 2.0220711e7 │\n",
       "│ 50%        ┆ 2.0220718e7 │\n",
       "│ 75%        ┆ 2.0220718e7 │\n",
       "│ max        ┆ 2.0220721e7 │\n",
       "└────────────┴─────────────┘"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "199cad11-0af8-41b3-a70f-6864982a904c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.null_count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "4f27e0ca-36be-4e66-8a01-5d2416934d62",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rows: 17\n",
      "Columns: 16\n",
      "$ 发生日期 <i64> 20220721, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718\n",
      "$ 证券代码 <str> '600269', '204007', '=\"002462\"', '600408', '600648', '600269', '600015', '601992', '600894', '601077'\n",
      "$ 证券名称 <str> '赣粤高速', 'GC007', '嘉事堂', '安泰集团', '外高桥', '赣粤高速', '华夏银行', '金隅集团', '广日股份', '渝农商行'\n",
      "$ 买卖标志 <str> '卖出', '卖出', '卖出', '买入', '买入', '买入', '买入', '卖出', '卖出', '卖出'\n",
      "$ 业务名称 <str> '股息入账', '拆出质押购回', '证券卖出', '证券买入', '证券买入', '证券买入', '证券买入', '证券卖出', '证券卖出', '证券卖出'\n",
      "$ 成交时间 <str> '16:00:00', '19:03:27', '09:38:10', '09:44:52', '09:44:31', '09:43:38', '09:42:51', '09:39:28', '09:39:06', '09:38:30'\n",
      "$ 成交数量 <str> '=\"0.00\"', '-580.00', '-10400.00', '47000.00', '11900.00', '40700.00', '30000.00', '-54000.00', '-21400.00', '-38300.00'\n",
      "$ 成交价格 <f64> 3.6, 1.675, 13.2062, 3.19, 12.6066, 3.69, 5.07, 2.5683, 6.5419, 3.58\n",
      "$ 成交金额 <f64> 4884.0, 58000.0, 137344.0, 149930.0, 150019.0, 150183.0, 152100.0, 138686.0, 139996.0, 137114.0\n",
      "$ 发生金额 <f64> 4884.0, 58018.63, 137184.67, -149955.5, -150044.49, -150208.53, -152125.86, 138523.74, 139832.12, 136953.55\n",
      "$ 手续费  <str> '=\"0.00\"', '=\"0.00\"', '21.98', '23.99', '24.00', '24.03', '24.34', '22.19', '22.40', '21.94'\n",
      "$ 印花税  <str> '=\"0.00\"', '=\"0.00\"', '137.35', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '138.69', '140.02', '137.13'\n",
      "$ 过户费  <str> '=\"0.00\"', '=\"0.00\"', '1.38', '1.51', '1.49', '1.50', '1.52', '1.38', '1.46', '1.38'\n",
      "$ 其他费  <str> '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"'\n",
      "$ 备注   <str> '股息入账:赣粤高速600269; 权益股数:40700;', '融券购回:18.63实际占款天数：7-888880', '证券卖出', '证券买入', '证券买入', '证券买入', '证券买入', '证券卖出', '证券卖出', '证券卖出'\n",
      "$ 币种   <str> '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币'\n",
      "\n"
     ]
    }
   ],
   "source": [
    "df.glimpse()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "8f3a9594-8683-4a83-b000-5dfc894989cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>foo</th><th>foo2</th></tr><tr><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;asldjl&quot;</td><td>&quot;sldj&quot;</td></tr><tr><td>&quot;jjjask&quot;</td><td>&quot;jjjask&quot;</td></tr><tr><td>&quot;hasna&quot;</td><td>&quot;hasn&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3, 2)\n",
       "┌────────┬────────┐\n",
       "│ foo    ┆ foo2   │\n",
       "│ ---    ┆ ---    │\n",
       "│ str    ┆ str    │\n",
       "╞════════╪════════╡\n",
       "│ asldjl ┆ sldj   │\n",
       "│ jjjask ┆ jjjask │\n",
       "│ hasna  ┆ hasn   │\n",
       "└────────┴────────┘"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pl.DataFrame({\"foo\": [\"asldjl\", \"jjjask\", \"hasna\"]})\n",
    "df.with_columns(foo2=pl.col(\"foo\").str.strip_chars(\"al\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "2828ebb3-515e-4c26-8cea-a6729f9c6345",
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_df_湘财(f: str | Path) -> pl.DataFrame:\n",
    "    df = pl.read_csv(\n",
    "        f,\n",
    "        encoding=\"GB18030\",\n",
    "        separator=\"\\t\",\n",
    "        infer_schema=False,\n",
    "    )\n",
    "    df = df.with_columns(\n",
    "        pl.selectors.all().str.strip_prefix(\"=\").str.strip_chars('\"'),\n",
    "    ).with_columns(\n",
    "        pl.col(\"发生日期\").str.to_date(\"%Y%m%d\"),\n",
    "        pl.col(\"成交时间\").str.to_time(),\n",
    "        pl.col(\n",
    "            \"成交数量\",\n",
    "            \"成交价格\",\n",
    "            \"成交金额\",\n",
    "            \"发生金额\",\n",
    "            \"手续费\",\n",
    "            \"印花税\",\n",
    "            \"过户费\",\n",
    "            \"其他费\",\n",
    "        ).cast(pl.Float64),\n",
    "    )\n",
    "    df = df.filter(\n",
    "        pl.col(\"业务名称\").is_in([\"证券买入\", \"证券卖出\"]),\n",
    "    )\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "38dcf6ea-15f4-4d10-9c30-bf50d8f53f01",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "90cdf778-06d7-453b-84fd-002684552555",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = [read_df_湘财(f) for f in Path(\"stock_trades/\").glob(\"*-湘财.xls\")]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "3ccfc1c7-390c-4915-8db2-397a55e054bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.concat(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "de557a2a-23d0-4384-b58d-73a7fb84abec",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    券商=pl.lit(\"湘财\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "34fc15f8-3962-44e3-9080-248f25001f40",
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_df_海通普通(f: str | Path) -> pl.DataFrame:\n",
    "    df = pl.read_excel(\n",
    "        f,\n",
    "        schema_overrides={\n",
    "            \"成交日期\": pl.String,\n",
    "            \"成交时间\": pl.String,\n",
    "            \"成交数量\": pl.Float64,\n",
    "            \"成交金额\": pl.Float64,\n",
    "            \"印花税\": pl.Float64,\n",
    "            \"其他费\": pl.Float64,\n",
    "        },\n",
    "    )\n",
    "    df = df.filter(\n",
    "        (pl.col(\"成交时间\") != \"\")\n",
    "        & (pl.col(\"操作\").is_in([\"买\", \"卖\"]))\n",
    "        & (~pl.col(\"证券代码\").str.starts_with(\"1318\"))\n",
    "        & (~pl.col(\"证券代码\").str.starts_with(\"204\"))\n",
    "    ).with_columns(\n",
    "        pl.col(\"成交日期\").str.to_date(\"%Y%m%d\"),  # 根据实际日期格式调整\n",
    "        pl.col(\"成交时间\").str.to_time(),\n",
    "    )\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "7ddd5a4d-2b30-4874-a3e4-2b514c32a5e9",
   "metadata": {},
   "outputs": [],
   "source": [
    " df =[read_df_海通普通(p) for p in Path(\"stock_trades/\").glob(\"*-海通普通.xlsx\")]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "e1af6298-37fe-4b60-9db4-071d9d17b323",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pl.concat(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "7918d61f-2404-4a47-bc3e-2a052f1ee8b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 15)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券代码</th><th>证券名称</th><th>成交日期</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>操作</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>券商</th></tr><tr><td>str</td><td>str</td><td>date</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;002224&quot;</td><td>&quot;三 力 士&quot;</td><td>2023-05-23</td><td>09:58:07</td><td>10800.0</td><td>4.59</td><td>49572.0</td><td>-49576.96</td><td>&quot;买&quot;</td><td>4.96</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;三 力 士证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;300107&quot;</td><td>&quot;建新股份&quot;</td><td>2023-05-23</td><td>10:01:57</td><td>10000.0</td><td>5.0</td><td>50000.0</td><td>-50005.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;建新股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;603002&quot;</td><td>&quot;宏昌电子&quot;</td><td>2023-05-24</td><td>09:54:48</td><td>9800.0</td><td>5.06</td><td>49588.0</td><td>-49593.46</td><td>&quot;买&quot;</td><td>4.96</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;宏昌电子证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600178&quot;</td><td>&quot;东安动力&quot;</td><td>2023-05-24</td><td>09:59:17</td><td>16400.0</td><td>6.07</td><td>99548.0</td><td>-99558.97</td><td>&quot;买&quot;</td><td>9.95</td><td>0.0</td><td>1.02</td><td>0.0</td><td>&quot;东安动力证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600626&quot;</td><td>&quot;申达股份&quot;</td><td>2023-05-24</td><td>10:06:14</td><td>14800.0</td><td>3.37</td><td>49876.0</td><td>-49881.48</td><td>&quot;买&quot;</td><td>4.99</td><td>0.0</td><td>0.49</td><td>0.0</td><td>&quot;申达股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;603386&quot;</td><td>&quot;骏亚科技&quot;</td><td>2023-07-24</td><td>09:38:22</td><td>4500.0</td><td>11.32</td><td>50940.0</td><td>50883.51</td><td>&quot;卖&quot;</td><td>5.09</td><td>50.91</td><td>0.49</td><td>0.0</td><td>&quot;骏亚科技证券卖出&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;002225&quot;</td><td>&quot;濮耐股份&quot;</td><td>2023-07-24</td><td>09:42:11</td><td>13200.0</td><td>3.8</td><td>50160.0</td><td>-50165.02</td><td>&quot;买&quot;</td><td>5.02</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;濮耐股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600735&quot;</td><td>&quot;新华锦&quot;</td><td>2023-07-24</td><td>09:48:27</td><td>8200.0</td><td>6.07</td><td>49774.0</td><td>-49779.48</td><td>&quot;买&quot;</td><td>4.98</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;新华锦证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;300642&quot;</td><td>&quot;透景生命&quot;</td><td>2023-07-24</td><td>09:49:52</td><td>2500.0</td><td>19.69</td><td>49225.0</td><td>-49229.92</td><td>&quot;买&quot;</td><td>4.92</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;透景生命证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;000823&quot;</td><td>&quot;超声电子&quot;</td><td>2023-07-24</td><td>09:52:23</td><td>5400.0</td><td>9.38</td><td>50652.0</td><td>-50657.07</td><td>&quot;买&quot;</td><td>5.07</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;超声电子证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 15)\n",
       "┌──────────┬──────────┬────────────┬──────────┬───┬────────┬────────┬──────────────────┬──────────┐\n",
       "│ 证券代码 ┆ 证券名称 ┆ 成交日期   ┆ 成交时间 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注             ┆ 券商     │\n",
       "│ ---      ┆ ---      ┆ ---        ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---              ┆ ---      │\n",
       "│ str      ┆ str      ┆ date       ┆ time     ┆   ┆ f64    ┆ f64    ┆ str              ┆ str      │\n",
       "╞══════════╪══════════╪════════════╪══════════╪═══╪════════╪════════╪══════════════════╪══════════╡\n",
       "│ 002224   ┆ 三 力 士 ┆ 2023-05-23 ┆ 09:58:07 ┆ … ┆ 0.0    ┆ 0.0    ┆ 三 力 士证券买入 ┆ 海通普通 │\n",
       "│ 300107   ┆ 建新股份 ┆ 2023-05-23 ┆ 10:01:57 ┆ … ┆ 0.0    ┆ 0.0    ┆ 建新股份证券买入 ┆ 海通普通 │\n",
       "│ 603002   ┆ 宏昌电子 ┆ 2023-05-24 ┆ 09:54:48 ┆ … ┆ 0.5    ┆ 0.0    ┆ 宏昌电子证券买入 ┆ 海通普通 │\n",
       "│ 600178   ┆ 东安动力 ┆ 2023-05-24 ┆ 09:59:17 ┆ … ┆ 1.02   ┆ 0.0    ┆ 东安动力证券买入 ┆ 海通普通 │\n",
       "│ 600626   ┆ 申达股份 ┆ 2023-05-24 ┆ 10:06:14 ┆ … ┆ 0.49   ┆ 0.0    ┆ 申达股份证券买入 ┆ 海通普通 │\n",
       "│ …        ┆ …        ┆ …          ┆ …        ┆ … ┆ …      ┆ …      ┆ …                ┆ …        │\n",
       "│ 603386   ┆ 骏亚科技 ┆ 2023-07-24 ┆ 09:38:22 ┆ … ┆ 0.49   ┆ 0.0    ┆ 骏亚科技证券卖出 ┆ 海通普通 │\n",
       "│ 002225   ┆ 濮耐股份 ┆ 2023-07-24 ┆ 09:42:11 ┆ … ┆ 0.0    ┆ 0.0    ┆ 濮耐股份证券买入 ┆ 海通普通 │\n",
       "│ 600735   ┆ 新华锦   ┆ 2023-07-24 ┆ 09:48:27 ┆ … ┆ 0.5    ┆ 0.0    ┆ 新华锦证券买入   ┆ 海通普通 │\n",
       "│ 300642   ┆ 透景生命 ┆ 2023-07-24 ┆ 09:49:52 ┆ … ┆ 0.0    ┆ 0.0    ┆ 透景生命证券买入 ┆ 海通普通 │\n",
       "│ 000823   ┆ 超声电子 ┆ 2023-07-24 ┆ 09:52:23 ┆ … ┆ 0.0    ┆ 0.0    ┆ 超声电子证券买入 ┆ 海通普通 │\n",
       "└──────────┴──────────┴────────────┴──────────┴───┴────────┴────────┴──────────────────┴──────────┘"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = [read_df_海通普通(p) for p in Path(\"stock_trades/\").glob(\"*-海通普通.xlsx\")]\n",
    "df = pl.concat(df)\n",
    "d2 = df.with_columns(\n",
    "    券商=pl.lit(\"海通普通\"),\n",
    ")\n",
    "d2.sort(\"成交日期\", \"成交时间\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "bd41ea68-1df8-4c22-a78f-db383e69382e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 15)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券代码</th><th>证券名称</th><th>成交日期</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>操作</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>券商</th></tr><tr><td>str</td><td>str</td><td>date</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;600638&quot;</td><td>&quot;新黄浦&quot;</td><td>2023-07-26</td><td>09:33:56</td><td>9300.0</td><td>6.526</td><td>60696.0</td><td>60628.01</td><td>&quot;卖&quot;</td><td>6.68</td><td>60.7</td><td>0.61</td><td>0.0</td><td>&quot;新黄浦证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002492&quot;</td><td>&quot;恒基达鑫&quot;</td><td>2023-07-27</td><td>09:30:42</td><td>8700.0</td><td>6.12</td><td>53244.0</td><td>53184.91</td><td>&quot;卖&quot;</td><td>5.86</td><td>53.23</td><td>0.0</td><td>0.0</td><td>&quot;恒基达鑫证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002136&quot;</td><td>&quot;安 纳 达&quot;</td><td>2023-07-27</td><td>09:32:52</td><td>4400.0</td><td>11.881</td><td>52277.0</td><td>52218.97</td><td>&quot;卖&quot;</td><td>5.75</td><td>52.28</td><td>0.0</td><td>0.0</td><td>&quot;安 纳 达证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;600300&quot;</td><td>&quot;维维股份&quot;</td><td>2023-08-04</td><td>09:36:55</td><td>16400.0</td><td>3.27</td><td>53628.0</td><td>53567.91</td><td>&quot;卖&quot;</td><td>5.9</td><td>53.65</td><td>0.54</td><td>0.0</td><td>&quot;维维股份证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;300241&quot;</td><td>&quot;瑞丰光电&quot;</td><td>2023-08-04</td><td>09:39:38</td><td>9700.0</td><td>5.13</td><td>49761.0</td><td>-49766.47</td><td>&quot;买&quot;</td><td>5.47</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;瑞丰光电证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;002956&quot;</td><td>&quot;西麦食品&quot;</td><td>2023-10-31</td><td>09:31:53</td><td>5000.0</td><td>14.13</td><td>70650.0</td><td>70607.91</td><td>&quot;卖&quot;</td><td>6.74</td><td>35.35</td><td>0.0</td><td>0.0</td><td>&quot;西麦食品证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;603214&quot;</td><td>&quot;爱婴室&quot;</td><td>2023-10-31</td><td>09:39:57</td><td>3100.0</td><td>15.84</td><td>49104.0</td><td>-49109.51</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.51</td><td>0.0</td><td>&quot;爱婴室证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;300132&quot;</td><td>&quot;青松股份&quot;</td><td>2023-10-31</td><td>09:40:55</td><td>9600.0</td><td>5.21</td><td>50016.0</td><td>-50021.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;青松股份证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002492&quot;</td><td>&quot;恒基达鑫&quot;</td><td>2023-10-31</td><td>09:43:13</td><td>8400.0</td><td>5.91</td><td>49644.0</td><td>-49649.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;恒基达鑫证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002111&quot;</td><td>&quot;威海广泰&quot;</td><td>2023-10-31</td><td>09:44:45</td><td>5400.0</td><td>9.24</td><td>49896.0</td><td>-49901.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;威海广泰证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 15)\n",
       "┌──────────┬──────────┬────────────┬──────────┬───┬────────┬────────┬──────────────────┬──────────┐\n",
       "│ 证券代码 ┆ 证券名称 ┆ 成交日期   ┆ 成交时间 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注             ┆ 券商     │\n",
       "│ ---      ┆ ---      ┆ ---        ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---              ┆ ---      │\n",
       "│ str      ┆ str      ┆ date       ┆ time     ┆   ┆ f64    ┆ f64    ┆ str              ┆ str      │\n",
       "╞══════════╪══════════╪════════════╪══════════╪═══╪════════╪════════╪══════════════════╪══════════╡\n",
       "│ 600638   ┆ 新黄浦   ┆ 2023-07-26 ┆ 09:33:56 ┆ … ┆ 0.61   ┆ 0.0    ┆ 新黄浦证券卖出   ┆ 海通两融 │\n",
       "│ 002492   ┆ 恒基达鑫 ┆ 2023-07-27 ┆ 09:30:42 ┆ … ┆ 0.0    ┆ 0.0    ┆ 恒基达鑫证券卖出 ┆ 海通两融 │\n",
       "│ 002136   ┆ 安 纳 达 ┆ 2023-07-27 ┆ 09:32:52 ┆ … ┆ 0.0    ┆ 0.0    ┆ 安 纳 达证券卖出 ┆ 海通两融 │\n",
       "│ 600300   ┆ 维维股份 ┆ 2023-08-04 ┆ 09:36:55 ┆ … ┆ 0.54   ┆ 0.0    ┆ 维维股份证券卖出 ┆ 海通两融 │\n",
       "│ 300241   ┆ 瑞丰光电 ┆ 2023-08-04 ┆ 09:39:38 ┆ … ┆ 0.0    ┆ 0.0    ┆ 瑞丰光电证券买入 ┆ 海通两融 │\n",
       "│ …        ┆ …        ┆ …          ┆ …        ┆ … ┆ …      ┆ …      ┆ …                ┆ …        │\n",
       "│ 002956   ┆ 西麦食品 ┆ 2023-10-31 ┆ 09:31:53 ┆ … ┆ 0.0    ┆ 0.0    ┆ 西麦食品证券卖出 ┆ 海通两融 │\n",
       "│ 603214   ┆ 爱婴室   ┆ 2023-10-31 ┆ 09:39:57 ┆ … ┆ 0.51   ┆ 0.0    ┆ 爱婴室证券买入   ┆ 海通两融 │\n",
       "│ 300132   ┆ 青松股份 ┆ 2023-10-31 ┆ 09:40:55 ┆ … ┆ 0.0    ┆ 0.0    ┆ 青松股份证券买入 ┆ 海通两融 │\n",
       "│ 002492   ┆ 恒基达鑫 ┆ 2023-10-31 ┆ 09:43:13 ┆ … ┆ 0.0    ┆ 0.0    ┆ 恒基达鑫证券买入 ┆ 海通两融 │\n",
       "│ 002111   ┆ 威海广泰 ┆ 2023-10-31 ┆ 09:44:45 ┆ … ┆ 0.0    ┆ 0.0    ┆ 威海广泰证券买入 ┆ 海通两融 │\n",
       "└──────────┴──────────┴────────────┴──────────┴───┴────────┴────────┴──────────────────┴──────────┘"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = [read_df_海通普通(p) for p in Path(\"stock_trades/\").glob(\"*-海通两融.xlsx\")]\n",
    "df = pl.concat(df)\n",
    "d3 = df.with_columns(\n",
    "    券商=pl.lit(\"海通两融\"),\n",
    ")\n",
    "d3.sort(\"成交日期\", \"成交时间\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "7fabc3a4-026b-450c-b484-3442a46f5159",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (257, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th><th>券商</th></tr><tr><td>date</td><td>str</td><td>str</td><td>str</td><td>str</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>2022-07-18</td><td>&quot;002462&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>09:38:10</td><td>-10400.0</td><td>13.2062</td><td>137344.0</td><td>137184.67</td><td>21.98</td><td>137.35</td><td>1.38</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2022-07-18</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>09:44:52</td><td>47000.0</td><td>3.19</td><td>149930.0</td><td>-149955.5</td><td>23.99</td><td>0.0</td><td>1.51</td><td>0.0</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2022-07-18</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>09:44:31</td><td>11900.0</td><td>12.6066</td><td>150019.0</td><td>-150044.49</td><td>24.0</td><td>0.0</td><td>1.49</td><td>0.0</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2022-07-18</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>09:43:38</td><td>40700.0</td><td>3.69</td><td>150183.0</td><td>-150208.53</td><td>24.03</td><td>0.0</td><td>1.5</td><td>0.0</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2022-07-18</td><td>&quot;600015&quot;</td><td>&quot;华夏银行&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>09:42:51</td><td>30000.0</td><td>5.07</td><td>152100.0</td><td>-152125.86</td><td>24.34</td><td>0.0</td><td>1.52</td><td>0.0</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>2023-06-19</td><td>&quot;603967&quot;</td><td>&quot;中创物流&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>10:18:46</td><td>-5000.0</td><td>9.13</td><td>45650.0</td><td>45596.59</td><td>7.3</td><td>45.65</td><td>0.46</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2023-06-12</td><td>&quot;300641&quot;</td><td>&quot;正丹股份&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>13:22:32</td><td>-9600.0</td><td>5.05</td><td>48480.0</td><td>48423.76</td><td>7.76</td><td>48.48</td><td>0.48</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2023-06-02</td><td>&quot;000655&quot;</td><td>&quot;金岭矿业&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>10:26:35</td><td>-7500.0</td><td>6.48</td><td>48600.0</td><td>48543.61</td><td>7.78</td><td>48.61</td><td>0.47</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2023-06-01</td><td>&quot;300214&quot;</td><td>&quot;日科化学&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>10:45:35</td><td>-7400.0</td><td>6.8</td><td>50320.0</td><td>50261.63</td><td>8.05</td><td>50.32</td><td>0.51</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr><tr><td>2023-09-11</td><td>&quot;603577&quot;</td><td>&quot;汇金通&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>09:46:10</td><td>-5100.0</td><td>9.3024</td><td>47442.0</td><td>47410.89</td><td>6.9</td><td>23.72</td><td>0.49</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td><td>&quot;湘财&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (257, 17)\n",
       "┌────────────┬──────────┬──────────┬──────────┬───┬────────┬──────────┬────────┬──────┐\n",
       "│ 发生日期   ┆ 证券代码 ┆ 证券名称 ┆ 买卖标志 ┆ … ┆ 其他费 ┆ 备注     ┆ 币种   ┆ 券商 │\n",
       "│ ---        ┆ ---      ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---      ┆ ---    ┆ ---  │\n",
       "│ date       ┆ str      ┆ str      ┆ str      ┆   ┆ f64    ┆ str      ┆ str    ┆ str  │\n",
       "╞════════════╪══════════╪══════════╪══════════╪═══╪════════╪══════════╪════════╪══════╡\n",
       "│ 2022-07-18 ┆ 002462   ┆ 嘉事堂   ┆ 卖出     ┆ … ┆ 0.0    ┆ 证券卖出 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2022-07-18 ┆ 600408   ┆ 安泰集团 ┆ 买入     ┆ … ┆ 0.0    ┆ 证券买入 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2022-07-18 ┆ 600648   ┆ 外高桥   ┆ 买入     ┆ … ┆ 0.0    ┆ 证券买入 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2022-07-18 ┆ 600269   ┆ 赣粤高速 ┆ 买入     ┆ … ┆ 0.0    ┆ 证券买入 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2022-07-18 ┆ 600015   ┆ 华夏银行 ┆ 买入     ┆ … ┆ 0.0    ┆ 证券买入 ┆ 人民币 ┆ 湘财 │\n",
       "│ …          ┆ …        ┆ …        ┆ …        ┆ … ┆ …      ┆ …        ┆ …      ┆ …    │\n",
       "│ 2023-06-19 ┆ 603967   ┆ 中创物流 ┆ 卖出     ┆ … ┆ 0.0    ┆ 证券卖出 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2023-06-12 ┆ 300641   ┆ 正丹股份 ┆ 卖出     ┆ … ┆ 0.0    ┆ 证券卖出 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2023-06-02 ┆ 000655   ┆ 金岭矿业 ┆ 卖出     ┆ … ┆ 0.0    ┆ 证券卖出 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2023-06-01 ┆ 300214   ┆ 日科化学 ┆ 卖出     ┆ … ┆ 0.0    ┆ 证券卖出 ┆ 人民币 ┆ 湘财 │\n",
       "│ 2023-09-11 ┆ 603577   ┆ 汇金通   ┆ 卖出     ┆ … ┆ 0.0    ┆ 证券卖出 ┆ 人民币 ┆ 湘财 │\n",
       "└────────────┴──────────┴──────────┴──────────┴───┴────────┴──────────┴────────┴──────┘"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "04957d21-4ec6-4e7c-a38d-604215137f9e",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.select(\n",
    "    券商=pl.col(\"券商\"),\n",
    "    交易日期=pl.col(\"发生日期\"),\n",
    "    交易时间=pl.col(\"成交时间\"),\n",
    "    证券代码=pl.col(\"证券代码\"),\n",
    "    证券名称=pl.col(\"证券名称\"),\n",
    "    买卖标志=pl.col(\"业务名称\").replace({\"证券卖出\": \"卖出\", \"证券买入\": \"买入\"}),\n",
    "    成交价格=pl.col(\"成交价格\"),\n",
    "    成交数量=pl.col(\"成交数量\").abs(),\n",
    "    成交金额=pl.col(\"成交金额\"),\n",
    "    手续费=pl.col(\"手续费\"),\n",
    "    印花税=pl.col(\"印花税\"),\n",
    "    过户费=pl.col(\"过户费\"),\n",
    "    其他费=pl.col(\"其他费\"),\n",
    "    发生金额=pl.col(\"发生金额\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "b2b8a3ed-bfa0-493e-9fdc-60303728a798",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 15)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券代码</th><th>证券名称</th><th>成交日期</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>操作</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>券商</th></tr><tr><td>str</td><td>str</td><td>date</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;600626&quot;</td><td>&quot;申达股份&quot;</td><td>2023-05-24</td><td>10:06:14</td><td>14800.0</td><td>3.37</td><td>49876.0</td><td>-49881.48</td><td>&quot;买&quot;</td><td>4.99</td><td>0.0</td><td>0.49</td><td>0.0</td><td>&quot;申达股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600178&quot;</td><td>&quot;东安动力&quot;</td><td>2023-05-24</td><td>09:59:17</td><td>16400.0</td><td>6.07</td><td>99548.0</td><td>-99558.97</td><td>&quot;买&quot;</td><td>9.95</td><td>0.0</td><td>1.02</td><td>0.0</td><td>&quot;东安动力证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;603002&quot;</td><td>&quot;宏昌电子&quot;</td><td>2023-05-24</td><td>09:54:48</td><td>9800.0</td><td>5.06</td><td>49588.0</td><td>-49593.46</td><td>&quot;买&quot;</td><td>4.96</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;宏昌电子证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;300107&quot;</td><td>&quot;建新股份&quot;</td><td>2023-05-23</td><td>10:01:57</td><td>10000.0</td><td>5.0</td><td>50000.0</td><td>-50005.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;建新股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;002224&quot;</td><td>&quot;三 力 士&quot;</td><td>2023-05-23</td><td>09:58:07</td><td>10800.0</td><td>4.59</td><td>49572.0</td><td>-49576.96</td><td>&quot;买&quot;</td><td>4.96</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;三 力 士证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;605196&quot;</td><td>&quot;华通线缆&quot;</td><td>2023-07-17</td><td>10:03:09</td><td>7200.0</td><td>7.81</td><td>56232.0</td><td>56169.59</td><td>&quot;卖&quot;</td><td>5.62</td><td>56.23</td><td>0.56</td><td>0.0</td><td>&quot;华通线缆证券卖出&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;002842&quot;</td><td>&quot;翔鹭钨业&quot;</td><td>2023-07-11</td><td>10:04:39</td><td>5900.0</td><td>8.68</td><td>51212.0</td><td>51155.66</td><td>&quot;卖&quot;</td><td>5.12</td><td>51.22</td><td>0.0</td><td>0.0</td><td>&quot;翔鹭钨业证券卖出&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;002331&quot;</td><td>&quot;皖通科技&quot;</td><td>2023-07-11</td><td>10:03:52</td><td>6900.0</td><td>7.33</td><td>50577.0</td><td>50521.36</td><td>&quot;卖&quot;</td><td>5.06</td><td>50.58</td><td>0.0</td><td>0.0</td><td>&quot;皖通科技证券卖出&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600300&quot;</td><td>&quot;维维股份&quot;</td><td>2023-07-11</td><td>10:13:04</td><td>16400.0</td><td>3.05</td><td>50020.0</td><td>-50025.5</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;维维股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600287&quot;</td><td>&quot;江苏舜天&quot;</td><td>2023-07-11</td><td>10:08:50</td><td>9900.0</td><td>5.06</td><td>50094.0</td><td>-50099.51</td><td>&quot;买&quot;</td><td>5.01</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;江苏舜天证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 15)\n",
       "┌──────────┬──────────┬────────────┬──────────┬───┬────────┬────────┬──────────────────┬──────────┐\n",
       "│ 证券代码 ┆ 证券名称 ┆ 成交日期   ┆ 成交时间 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注             ┆ 券商     │\n",
       "│ ---      ┆ ---      ┆ ---        ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---              ┆ ---      │\n",
       "│ str      ┆ str      ┆ date       ┆ time     ┆   ┆ f64    ┆ f64    ┆ str              ┆ str      │\n",
       "╞══════════╪══════════╪════════════╪══════════╪═══╪════════╪════════╪══════════════════╪══════════╡\n",
       "│ 600626   ┆ 申达股份 ┆ 2023-05-24 ┆ 10:06:14 ┆ … ┆ 0.49   ┆ 0.0    ┆ 申达股份证券买入 ┆ 海通普通 │\n",
       "│ 600178   ┆ 东安动力 ┆ 2023-05-24 ┆ 09:59:17 ┆ … ┆ 1.02   ┆ 0.0    ┆ 东安动力证券买入 ┆ 海通普通 │\n",
       "│ 603002   ┆ 宏昌电子 ┆ 2023-05-24 ┆ 09:54:48 ┆ … ┆ 0.5    ┆ 0.0    ┆ 宏昌电子证券买入 ┆ 海通普通 │\n",
       "│ 300107   ┆ 建新股份 ┆ 2023-05-23 ┆ 10:01:57 ┆ … ┆ 0.0    ┆ 0.0    ┆ 建新股份证券买入 ┆ 海通普通 │\n",
       "│ 002224   ┆ 三 力 士 ┆ 2023-05-23 ┆ 09:58:07 ┆ … ┆ 0.0    ┆ 0.0    ┆ 三 力 士证券买入 ┆ 海通普通 │\n",
       "│ …        ┆ …        ┆ …          ┆ …        ┆ … ┆ …      ┆ …      ┆ …                ┆ …        │\n",
       "│ 605196   ┆ 华通线缆 ┆ 2023-07-17 ┆ 10:03:09 ┆ … ┆ 0.56   ┆ 0.0    ┆ 华通线缆证券卖出 ┆ 海通普通 │\n",
       "│ 002842   ┆ 翔鹭钨业 ┆ 2023-07-11 ┆ 10:04:39 ┆ … ┆ 0.0    ┆ 0.0    ┆ 翔鹭钨业证券卖出 ┆ 海通普通 │\n",
       "│ 002331   ┆ 皖通科技 ┆ 2023-07-11 ┆ 10:03:52 ┆ … ┆ 0.0    ┆ 0.0    ┆ 皖通科技证券卖出 ┆ 海通普通 │\n",
       "│ 600300   ┆ 维维股份 ┆ 2023-07-11 ┆ 10:13:04 ┆ … ┆ 0.5    ┆ 0.0    ┆ 维维股份证券买入 ┆ 海通普通 │\n",
       "│ 600287   ┆ 江苏舜天 ┆ 2023-07-11 ┆ 10:08:50 ┆ … ┆ 0.5    ┆ 0.0    ┆ 江苏舜天证券买入 ┆ 海通普通 │\n",
       "└──────────┴──────────┴────────────┴──────────┴───┴────────┴────────┴──────────────────┴──────────┘"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "7a699373-15e3-4e31-b84e-63ca87367dcb",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.select(\n",
    "    券商=pl.col(\"券商\"),\n",
    "    交易日期=pl.col(\"成交日期\"),\n",
    "    交易时间=pl.col(\"成交时间\"),\n",
    "    证券代码=pl.col(\"证券代码\"),\n",
    "    证券名称=pl.col(\"证券名称\"),\n",
    "    买卖标志=pl.col(\"操作\").replace({\"卖\": \"卖出\", \"买\": \"买入\"}),\n",
    "    成交价格=pl.col(\"成交价格\"),\n",
    "    成交数量=pl.col(\"成交数量\").abs(),\n",
    "    成交金额=pl.col(\"成交金额\"),\n",
    "    手续费=pl.col(\"手续费\"),\n",
    "    印花税=pl.col(\"印花税\"),\n",
    "    过户费=pl.col(\"过户费\"),\n",
    "    其他费=pl.col(\"其他费\"),\n",
    "    发生金额=pl.col(\"发生金额\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "4ddced21-322c-448f-aa80-bc296d2c7c76",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 14)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>券商</th><th>交易日期</th><th>交易时间</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>成交价格</th><th>成交数量</th><th>成交金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>发生金额</th></tr><tr><td>str</td><td>date</td><td>time</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;海通普通&quot;</td><td>2023-05-24</td><td>10:06:14</td><td>&quot;600626&quot;</td><td>&quot;申达股份&quot;</td><td>&quot;买入&quot;</td><td>3.37</td><td>14800.0</td><td>49876.0</td><td>4.99</td><td>0.0</td><td>0.49</td><td>0.0</td><td>-49881.48</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-05-24</td><td>09:59:17</td><td>&quot;600178&quot;</td><td>&quot;东安动力&quot;</td><td>&quot;买入&quot;</td><td>6.07</td><td>16400.0</td><td>99548.0</td><td>9.95</td><td>0.0</td><td>1.02</td><td>0.0</td><td>-99558.97</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-05-24</td><td>09:54:48</td><td>&quot;603002&quot;</td><td>&quot;宏昌电子&quot;</td><td>&quot;买入&quot;</td><td>5.06</td><td>9800.0</td><td>49588.0</td><td>4.96</td><td>0.0</td><td>0.5</td><td>0.0</td><td>-49593.46</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-05-23</td><td>10:01:57</td><td>&quot;300107&quot;</td><td>&quot;建新股份&quot;</td><td>&quot;买入&quot;</td><td>5.0</td><td>10000.0</td><td>50000.0</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>-50005.0</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-05-23</td><td>09:58:07</td><td>&quot;002224&quot;</td><td>&quot;三 力 士&quot;</td><td>&quot;买入&quot;</td><td>4.59</td><td>10800.0</td><td>49572.0</td><td>4.96</td><td>0.0</td><td>0.0</td><td>0.0</td><td>-49576.96</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-07-17</td><td>10:03:09</td><td>&quot;605196&quot;</td><td>&quot;华通线缆&quot;</td><td>&quot;卖出&quot;</td><td>7.81</td><td>7200.0</td><td>56232.0</td><td>5.62</td><td>56.23</td><td>0.56</td><td>0.0</td><td>56169.59</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-07-11</td><td>10:04:39</td><td>&quot;002842&quot;</td><td>&quot;翔鹭钨业&quot;</td><td>&quot;卖出&quot;</td><td>8.68</td><td>5900.0</td><td>51212.0</td><td>5.12</td><td>51.22</td><td>0.0</td><td>0.0</td><td>51155.66</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-07-11</td><td>10:03:52</td><td>&quot;002331&quot;</td><td>&quot;皖通科技&quot;</td><td>&quot;卖出&quot;</td><td>7.33</td><td>6900.0</td><td>50577.0</td><td>5.06</td><td>50.58</td><td>0.0</td><td>0.0</td><td>50521.36</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-07-11</td><td>10:13:04</td><td>&quot;600300&quot;</td><td>&quot;维维股份&quot;</td><td>&quot;买入&quot;</td><td>3.05</td><td>16400.0</td><td>50020.0</td><td>5.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>-50025.5</td></tr><tr><td>&quot;海通普通&quot;</td><td>2023-07-11</td><td>10:08:50</td><td>&quot;600287&quot;</td><td>&quot;江苏舜天&quot;</td><td>&quot;买入&quot;</td><td>5.06</td><td>9900.0</td><td>50094.0</td><td>5.01</td><td>0.0</td><td>0.5</td><td>0.0</td><td>-50099.51</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 14)\n",
       "┌──────────┬────────────┬──────────┬──────────┬───┬────────┬────────┬────────┬───────────┐\n",
       "│ 券商     ┆ 交易日期   ┆ 交易时间 ┆ 证券代码 ┆ … ┆ 印花税 ┆ 过户费 ┆ 其他费 ┆ 发生金额  │\n",
       "│ ---      ┆ ---        ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---       │\n",
       "│ str      ┆ date       ┆ time     ┆ str      ┆   ┆ f64    ┆ f64    ┆ f64    ┆ f64       │\n",
       "╞══════════╪════════════╪══════════╪══════════╪═══╪════════╪════════╪════════╪═══════════╡\n",
       "│ 海通普通 ┆ 2023-05-24 ┆ 10:06:14 ┆ 600626   ┆ … ┆ 0.0    ┆ 0.49   ┆ 0.0    ┆ -49881.48 │\n",
       "│ 海通普通 ┆ 2023-05-24 ┆ 09:59:17 ┆ 600178   ┆ … ┆ 0.0    ┆ 1.02   ┆ 0.0    ┆ -99558.97 │\n",
       "│ 海通普通 ┆ 2023-05-24 ┆ 09:54:48 ┆ 603002   ┆ … ┆ 0.0    ┆ 0.5    ┆ 0.0    ┆ -49593.46 │\n",
       "│ 海通普通 ┆ 2023-05-23 ┆ 10:01:57 ┆ 300107   ┆ … ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ -50005.0  │\n",
       "│ 海通普通 ┆ 2023-05-23 ┆ 09:58:07 ┆ 002224   ┆ … ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ -49576.96 │\n",
       "│ …        ┆ …          ┆ …        ┆ …        ┆ … ┆ …      ┆ …      ┆ …      ┆ …         │\n",
       "│ 海通普通 ┆ 2023-07-17 ┆ 10:03:09 ┆ 605196   ┆ … ┆ 56.23  ┆ 0.56   ┆ 0.0    ┆ 56169.59  │\n",
       "│ 海通普通 ┆ 2023-07-11 ┆ 10:04:39 ┆ 002842   ┆ … ┆ 51.22  ┆ 0.0    ┆ 0.0    ┆ 51155.66  │\n",
       "│ 海通普通 ┆ 2023-07-11 ┆ 10:03:52 ┆ 002331   ┆ … ┆ 50.58  ┆ 0.0    ┆ 0.0    ┆ 50521.36  │\n",
       "│ 海通普通 ┆ 2023-07-11 ┆ 10:13:04 ┆ 600300   ┆ … ┆ 0.0    ┆ 0.5    ┆ 0.0    ┆ -50025.5  │\n",
       "│ 海通普通 ┆ 2023-07-11 ┆ 10:08:50 ┆ 600287   ┆ … ┆ 0.0    ┆ 0.5    ┆ 0.0    ┆ -50099.51 │\n",
       "└──────────┴────────────┴──────────┴──────────┴───┴────────┴────────┴────────┴───────────┘"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "2ceb32d5-bd92-464e-b471-fdb05b9c2bce",
   "metadata": {},
   "outputs": [],
   "source": [
    "d3 = d3.select(\n",
    "    券商=pl.col(\"券商\"),\n",
    "    交易日期=pl.col(\"成交日期\"),\n",
    "    交易时间=pl.col(\"成交时间\"),\n",
    "    证券代码=pl.col(\"证券代码\"),\n",
    "    证券名称=pl.col(\"证券名称\"),\n",
    "    买卖标志=pl.col(\"操作\").replace({\"卖\": \"卖出\", \"买\": \"买入\"}),\n",
    "    成交价格=pl.col(\"成交价格\"),\n",
    "    成交数量=pl.col(\"成交数量\").abs(),\n",
    "    成交金额=pl.col(\"成交金额\"),\n",
    "    手续费=pl.col(\"手续费\"),\n",
    "    印花税=pl.col(\"印花税\"),\n",
    "    过户费=pl.col(\"过户费\"),\n",
    "    其他费=pl.col(\"其他费\"),\n",
    "    发生金额=pl.col(\"发生金额\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "37ea0792-c127-428d-80e8-731339e48eda",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 14)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>券商</th><th>交易日期</th><th>交易时间</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>成交价格</th><th>成交数量</th><th>成交金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>发生金额</th></tr><tr><td>str</td><td>date</td><td>time</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;海通两融&quot;</td><td>2023-07-26</td><td>09:33:56</td><td>&quot;600638&quot;</td><td>&quot;新黄浦&quot;</td><td>&quot;卖出&quot;</td><td>6.526</td><td>9300.0</td><td>60696.0</td><td>6.68</td><td>60.7</td><td>0.61</td><td>0.0</td><td>60628.01</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-07-27</td><td>09:30:42</td><td>&quot;002492&quot;</td><td>&quot;恒基达鑫&quot;</td><td>&quot;卖出&quot;</td><td>6.12</td><td>8700.0</td><td>53244.0</td><td>5.86</td><td>53.23</td><td>0.0</td><td>0.0</td><td>53184.91</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-07-27</td><td>09:32:52</td><td>&quot;002136&quot;</td><td>&quot;安 纳 达&quot;</td><td>&quot;卖出&quot;</td><td>11.881</td><td>4400.0</td><td>52277.0</td><td>5.75</td><td>52.28</td><td>0.0</td><td>0.0</td><td>52218.97</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-08-22</td><td>09:36:13</td><td>&quot;603967&quot;</td><td>&quot;中创物流&quot;</td><td>&quot;卖出&quot;</td><td>9.36</td><td>10600.0</td><td>99216.0</td><td>10.91</td><td>99.24</td><td>1.0</td><td>0.0</td><td>99104.85</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-08-04</td><td>10:07:37</td><td>&quot;603967&quot;</td><td>&quot;中创物流&quot;</td><td>&quot;买入&quot;</td><td>9.43</td><td>10600.0</td><td>99958.0</td><td>11.0</td><td>0.0</td><td>1.01</td><td>0.0</td><td>-99970.01</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-18</td><td>09:46:15</td><td>&quot;300464&quot;</td><td>&quot;星徽股份&quot;</td><td>&quot;卖出&quot;</td><td>5.74</td><td>16100.0</td><td>92414.0</td><td>8.82</td><td>46.21</td><td>0.0</td><td>0.0</td><td>92358.97</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-18</td><td>09:55:41</td><td>&quot;002661&quot;</td><td>&quot;克明食品&quot;</td><td>&quot;买入&quot;</td><td>9.42</td><td>8500.0</td><td>80072.0</td><td>7.64</td><td>0.0</td><td>0.0</td><td>0.0</td><td>-80079.64</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-09</td><td>09:48:02</td><td>&quot;002753&quot;</td><td>&quot;永东股份&quot;</td><td>&quot;买入&quot;</td><td>7.02</td><td>14200.0</td><td>99684.0</td><td>9.51</td><td>0.0</td><td>0.0</td><td>0.0</td><td>-99693.51</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-09</td><td>09:45:18</td><td>&quot;000698&quot;</td><td>&quot;沈阳化工&quot;</td><td>&quot;卖出&quot;</td><td>4.053</td><td>23800.0</td><td>96460.0</td><td>9.2</td><td>48.24</td><td>0.0</td><td>0.0</td><td>96402.56</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-09</td><td>09:44:40</td><td>&quot;605288&quot;</td><td>&quot;凯迪股份&quot;</td><td>&quot;卖出&quot;</td><td>40.838</td><td>2500.0</td><td>102094.0</td><td>9.74</td><td>51.05</td><td>1.0</td><td>0.0</td><td>102032.21</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 14)\n",
       "┌──────────┬────────────┬──────────┬──────────┬───┬────────┬────────┬────────┬───────────┐\n",
       "│ 券商     ┆ 交易日期   ┆ 交易时间 ┆ 证券代码 ┆ … ┆ 印花税 ┆ 过户费 ┆ 其他费 ┆ 发生金额  │\n",
       "│ ---      ┆ ---        ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---       │\n",
       "│ str      ┆ date       ┆ time     ┆ str      ┆   ┆ f64    ┆ f64    ┆ f64    ┆ f64       │\n",
       "╞══════════╪════════════╪══════════╪══════════╪═══╪════════╪════════╪════════╪═══════════╡\n",
       "│ 海通两融 ┆ 2023-07-26 ┆ 09:33:56 ┆ 600638   ┆ … ┆ 60.7   ┆ 0.61   ┆ 0.0    ┆ 60628.01  │\n",
       "│ 海通两融 ┆ 2023-07-27 ┆ 09:30:42 ┆ 002492   ┆ … ┆ 53.23  ┆ 0.0    ┆ 0.0    ┆ 53184.91  │\n",
       "│ 海通两融 ┆ 2023-07-27 ┆ 09:32:52 ┆ 002136   ┆ … ┆ 52.28  ┆ 0.0    ┆ 0.0    ┆ 52218.97  │\n",
       "│ 海通两融 ┆ 2023-08-22 ┆ 09:36:13 ┆ 603967   ┆ … ┆ 99.24  ┆ 1.0    ┆ 0.0    ┆ 99104.85  │\n",
       "│ 海通两融 ┆ 2023-08-04 ┆ 10:07:37 ┆ 603967   ┆ … ┆ 0.0    ┆ 1.01   ┆ 0.0    ┆ -99970.01 │\n",
       "│ …        ┆ …          ┆ …        ┆ …        ┆ … ┆ …      ┆ …      ┆ …      ┆ …         │\n",
       "│ 海通两融 ┆ 2023-10-18 ┆ 09:46:15 ┆ 300464   ┆ … ┆ 46.21  ┆ 0.0    ┆ 0.0    ┆ 92358.97  │\n",
       "│ 海通两融 ┆ 2023-10-18 ┆ 09:55:41 ┆ 002661   ┆ … ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ -80079.64 │\n",
       "│ 海通两融 ┆ 2023-10-09 ┆ 09:48:02 ┆ 002753   ┆ … ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ -99693.51 │\n",
       "│ 海通两融 ┆ 2023-10-09 ┆ 09:45:18 ┆ 000698   ┆ … ┆ 48.24  ┆ 0.0    ┆ 0.0    ┆ 96402.56  │\n",
       "│ 海通两融 ┆ 2023-10-09 ┆ 09:44:40 ┆ 605288   ┆ … ┆ 51.05  ┆ 1.0    ┆ 0.0    ┆ 102032.21 │\n",
       "└──────────┴────────────┴──────────┴──────────┴───┴────────┴────────┴────────┴───────────┘"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "df5f0d65-f4ed-4a47-881e-e0ee88e3cfaa",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pl.concat([d1, d2, d3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "c8f043c4-600a-4a25-8710-e608a6cf4c0f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (363, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>券商</th><th>交易日期</th><th>交易时间</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>成交价格</th><th>成交数量</th><th>成交金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>发生金额</th><th>成交金额2</th><th>成交金额D</th><th>发生金额D</th></tr><tr><td>str</td><td>date</td><td>time</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:44:52</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>3.19</td><td>47000.0</td><td>149930.0</td><td>23.99</td><td>0.0</td><td>1.51</td><td>0.0</td><td>-149955.5</td><td>478276.7</td><td>-328346.7</td><td>0.0</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:44:31</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>12.6066</td><td>11900.0</td><td>150019.0</td><td>24.0</td><td>0.0</td><td>1.49</td><td>0.0</td><td>-150044.49</td><td>1.8912e6</td><td>-1.7412e6</td><td>0.0</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:43:38</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;买入&quot;</td><td>3.69</td><td>40700.0</td><td>150183.0</td><td>24.03</td><td>0.0</td><td>1.5</td><td>0.0</td><td>-150208.53</td><td>554175.27</td><td>-403992.27</td><td>0.0</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:42:51</td><td>&quot;600015&quot;</td><td>&quot;华夏银行&quot;</td><td>&quot;买入&quot;</td><td>5.07</td><td>30000.0</td><td>152100.0</td><td>24.34</td><td>0.0</td><td>1.52</td><td>0.0</td><td>-152125.86</td><td>771147.0</td><td>-619047.0</td><td>0.0</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:39:28</td><td>&quot;601992&quot;</td><td>&quot;金隅集团&quot;</td><td>&quot;卖出&quot;</td><td>2.5683</td><td>54000.0</td><td>138686.0</td><td>22.19</td><td>138.69</td><td>1.38</td><td>0.0</td><td>138523.74</td><td>356187.2538</td><td>-217501.2538</td><td>0.0</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-10-24</td><td>09:37:27</td><td>&quot;300283&quot;</td><td>&quot;温州宏丰&quot;</td><td>&quot;买入&quot;</td><td>5.4038</td><td>12900.0</td><td>69709.0</td><td>11.15</td><td>0.0</td><td>0.83</td><td>0.0</td><td>-69720.15</td><td>376693.4942</td><td>-306984.4942</td><td>0.83</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-10-11</td><td>09:32:03</td><td>&quot;000900&quot;</td><td>&quot;现代投资&quot;</td><td>&quot;卖出&quot;</td><td>3.8465</td><td>34400.0</td><td>132321.0</td><td>21.17</td><td>132.35</td><td>1.31</td><td>0.0</td><td>132167.48</td><td>508972.7265</td><td>-376651.7265</td><td>1.31</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:38:10</td><td>&quot;002462&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>13.2062</td><td>10400.0</td><td>137344.0</td><td>21.98</td><td>137.35</td><td>1.38</td><td>0.0</td><td>137184.67</td><td>1.8138e6</td><td>-1.6764e6</td><td>1.38</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-11</td><td>09:33:37</td><td>&quot;000900&quot;</td><td>&quot;现代投资&quot;</td><td>&quot;买入&quot;</td><td>4.05</td><td>34400.0</td><td>139320.0</td><td>22.29</td><td>0.0</td><td>1.39</td><td>0.0</td><td>-139342.29</td><td>564246.0</td><td>-424926.0</td><td>1.39</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-11</td><td>09:38:16</td><td>&quot;002462&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;买入&quot;</td><td>13.51</td><td>10400.0</td><td>140504.0</td><td>22.48</td><td>0.0</td><td>1.41</td><td>0.0</td><td>-140526.48</td><td>1.8982e6</td><td>-1.7577e6</td><td>1.41</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (363, 17)\n",
       "┌──────┬────────────┬──────────┬──────────┬───┬────────────┬─────────────┬──────────────┬───────────┐\n",
       "│ 券商 ┆ 交易日期   ┆ 交易时间 ┆ 证券代码 ┆ … ┆ 发生金额   ┆ 成交金额2   ┆ 成交金额D    ┆ 发生金额D │\n",
       "│ ---  ┆ ---        ┆ ---      ┆ ---      ┆   ┆ ---        ┆ ---         ┆ ---          ┆ ---       │\n",
       "│ str  ┆ date       ┆ time     ┆ str      ┆   ┆ f64        ┆ f64         ┆ f64          ┆ f64       │\n",
       "╞══════╪════════════╪══════════╪══════════╪═══╪════════════╪═════════════╪══════════════╪═══════════╡\n",
       "│ 湘财 ┆ 2022-07-18 ┆ 09:44:52 ┆ 600408   ┆ … ┆ -149955.5  ┆ 478276.7    ┆ -328346.7    ┆ 0.0       │\n",
       "│ 湘财 ┆ 2022-07-18 ┆ 09:44:31 ┆ 600648   ┆ … ┆ -150044.49 ┆ 1.8912e6    ┆ -1.7412e6    ┆ 0.0       │\n",
       "│ 湘财 ┆ 2022-07-18 ┆ 09:43:38 ┆ 600269   ┆ … ┆ -150208.53 ┆ 554175.27   ┆ -403992.27   ┆ 0.0       │\n",
       "│ 湘财 ┆ 2022-07-18 ┆ 09:42:51 ┆ 600015   ┆ … ┆ -152125.86 ┆ 771147.0    ┆ -619047.0    ┆ 0.0       │\n",
       "│ 湘财 ┆ 2022-07-18 ┆ 09:39:28 ┆ 601992   ┆ … ┆ 138523.74  ┆ 356187.2538 ┆ -217501.2538 ┆ 0.0       │\n",
       "│ …    ┆ …          ┆ …        ┆ …        ┆ … ┆ …          ┆ …           ┆ …            ┆ …         │\n",
       "│ 湘财 ┆ 2022-10-24 ┆ 09:37:27 ┆ 300283   ┆ … ┆ -69720.15  ┆ 376693.4942 ┆ -306984.4942 ┆ 0.83      │\n",
       "│ 湘财 ┆ 2022-10-11 ┆ 09:32:03 ┆ 000900   ┆ … ┆ 132167.48  ┆ 508972.7265 ┆ -376651.7265 ┆ 1.31      │\n",
       "│ 湘财 ┆ 2022-07-18 ┆ 09:38:10 ┆ 002462   ┆ … ┆ 137184.67  ┆ 1.8138e6    ┆ -1.6764e6    ┆ 1.38      │\n",
       "│ 湘财 ┆ 2022-07-11 ┆ 09:33:37 ┆ 000900   ┆ … ┆ -139342.29 ┆ 564246.0    ┆ -424926.0    ┆ 1.39      │\n",
       "│ 湘财 ┆ 2022-07-11 ┆ 09:38:16 ┆ 002462   ┆ … ┆ -140526.48 ┆ 1.8982e6    ┆ -1.7577e6    ┆ 1.41      │\n",
       "└──────┴────────────┴──────────┴──────────┴───┴────────────┴─────────────┴──────────────┴───────────┘"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.with_columns(\n",
    "    成交金额2=pl.col(\"成交价格\") * pl.col(\"成交金额\"),\n",
    ").with_columns(\n",
    "    成交金额D=pl.col(\"成交金额\") - pl.col(\"成交金额2\"),\n",
    ").with_columns(\n",
    "    发生金额D=(\n",
    "        pl.col(\"发生金额\")\n",
    "        - (\n",
    "            pl.when(pl.col(\"买卖标志\") == \"买入\")\n",
    "            .then(-pl.col(\"成交金额\"))\n",
    "            .when(pl.col(\"买卖标志\") == \"卖出\")\n",
    "            .then(pl.col(\"成交金额\"))\n",
    "            - pl.col(\"手续费\")\n",
    "            - pl.col(\"印花税\")\n",
    "            - pl.col(\"过户费\")\n",
    "            - pl.col(\"其他费\")\n",
    "        )\n",
    "    ).round(4)\n",
    ").sort(\"发生金额D\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "a0fdad9f-3e35-44b5-8df1-4eef14e553ba",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.write_parquet(\"stock_trades.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "73b20229-aeb3-42d0-a773-adb9ccafbd23",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.write_csv(\"stock_trades.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "d3cab446-38e5-4b30-bbbe-5e7c4ed8aff2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<xlsxwriter.workbook.Workbook at 0x21e35544e90>"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.write_excel(\"stock_trades.xlsx\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "69b36f1c-46a1-42b5-9367-a04a570a1660",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (363, 14)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>券商</th><th>交易日期</th><th>交易时间</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>成交价格</th><th>成交数量</th><th>成交金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>发生金额</th></tr><tr><td>str</td><td>date</td><td>time</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:38:10</td><td>&quot;002462&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>13.2062</td><td>10400.0</td><td>137344.0</td><td>21.98</td><td>137.35</td><td>1.38</td><td>0.0</td><td>137184.67</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:44:52</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>3.19</td><td>47000.0</td><td>149930.0</td><td>23.99</td><td>0.0</td><td>1.51</td><td>0.0</td><td>-149955.5</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:44:31</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>12.6066</td><td>11900.0</td><td>150019.0</td><td>24.0</td><td>0.0</td><td>1.49</td><td>0.0</td><td>-150044.49</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:43:38</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;买入&quot;</td><td>3.69</td><td>40700.0</td><td>150183.0</td><td>24.03</td><td>0.0</td><td>1.5</td><td>0.0</td><td>-150208.53</td></tr><tr><td>&quot;湘财&quot;</td><td>2022-07-18</td><td>09:42:51</td><td>&quot;600015&quot;</td><td>&quot;华夏银行&quot;</td><td>&quot;买入&quot;</td><td>5.07</td><td>30000.0</td><td>152100.0</td><td>24.34</td><td>0.0</td><td>1.52</td><td>0.0</td><td>-152125.86</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-18</td><td>09:46:15</td><td>&quot;300464&quot;</td><td>&quot;星徽股份&quot;</td><td>&quot;卖出&quot;</td><td>5.74</td><td>16100.0</td><td>92414.0</td><td>8.82</td><td>46.21</td><td>0.0</td><td>0.0</td><td>92358.97</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-18</td><td>09:55:41</td><td>&quot;002661&quot;</td><td>&quot;克明食品&quot;</td><td>&quot;买入&quot;</td><td>9.42</td><td>8500.0</td><td>80072.0</td><td>7.64</td><td>0.0</td><td>0.0</td><td>0.0</td><td>-80079.64</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-09</td><td>09:48:02</td><td>&quot;002753&quot;</td><td>&quot;永东股份&quot;</td><td>&quot;买入&quot;</td><td>7.02</td><td>14200.0</td><td>99684.0</td><td>9.51</td><td>0.0</td><td>0.0</td><td>0.0</td><td>-99693.51</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-09</td><td>09:45:18</td><td>&quot;000698&quot;</td><td>&quot;沈阳化工&quot;</td><td>&quot;卖出&quot;</td><td>4.053</td><td>23800.0</td><td>96460.0</td><td>9.2</td><td>48.24</td><td>0.0</td><td>0.0</td><td>96402.56</td></tr><tr><td>&quot;海通两融&quot;</td><td>2023-10-09</td><td>09:44:40</td><td>&quot;605288&quot;</td><td>&quot;凯迪股份&quot;</td><td>&quot;卖出&quot;</td><td>40.838</td><td>2500.0</td><td>102094.0</td><td>9.74</td><td>51.05</td><td>1.0</td><td>0.0</td><td>102032.21</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (363, 14)\n",
       "┌──────────┬────────────┬──────────┬──────────┬───┬────────┬────────┬────────┬────────────┐\n",
       "│ 券商     ┆ 交易日期   ┆ 交易时间 ┆ 证券代码 ┆ … ┆ 印花税 ┆ 过户费 ┆ 其他费 ┆ 发生金额   │\n",
       "│ ---      ┆ ---        ┆ ---      ┆ ---      ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---        │\n",
       "│ str      ┆ date       ┆ time     ┆ str      ┆   ┆ f64    ┆ f64    ┆ f64    ┆ f64        │\n",
       "╞══════════╪════════════╪══════════╪══════════╪═══╪════════╪════════╪════════╪════════════╡\n",
       "│ 湘财     ┆ 2022-07-18 ┆ 09:38:10 ┆ 002462   ┆ … ┆ 137.35 ┆ 1.38   ┆ 0.0    ┆ 137184.67  │\n",
       "│ 湘财     ┆ 2022-07-18 ┆ 09:44:52 ┆ 600408   ┆ … ┆ 0.0    ┆ 1.51   ┆ 0.0    ┆ -149955.5  │\n",
       "│ 湘财     ┆ 2022-07-18 ┆ 09:44:31 ┆ 600648   ┆ … ┆ 0.0    ┆ 1.49   ┆ 0.0    ┆ -150044.49 │\n",
       "│ 湘财     ┆ 2022-07-18 ┆ 09:43:38 ┆ 600269   ┆ … ┆ 0.0    ┆ 1.5    ┆ 0.0    ┆ -150208.53 │\n",
       "│ 湘财     ┆ 2022-07-18 ┆ 09:42:51 ┆ 600015   ┆ … ┆ 0.0    ┆ 1.52   ┆ 0.0    ┆ -152125.86 │\n",
       "│ …        ┆ …          ┆ …        ┆ …        ┆ … ┆ …      ┆ …      ┆ …      ┆ …          │\n",
       "│ 海通两融 ┆ 2023-10-18 ┆ 09:46:15 ┆ 300464   ┆ … ┆ 46.21  ┆ 0.0    ┆ 0.0    ┆ 92358.97   │\n",
       "│ 海通两融 ┆ 2023-10-18 ┆ 09:55:41 ┆ 002661   ┆ … ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ -80079.64  │\n",
       "│ 海通两融 ┆ 2023-10-09 ┆ 09:48:02 ┆ 002753   ┆ … ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ -99693.51  │\n",
       "│ 海通两融 ┆ 2023-10-09 ┆ 09:45:18 ┆ 000698   ┆ … ┆ 48.24  ┆ 0.0    ┆ 0.0    ┆ 96402.56   │\n",
       "│ 海通两融 ┆ 2023-10-09 ┆ 09:44:40 ┆ 605288   ┆ … ┆ 51.05  ┆ 1.0    ┆ 0.0    ┆ 102032.21  │\n",
       "└──────────┴────────────┴──────────┴──────────┴───┴────────┴────────┴────────┴────────────┘"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pl.read_parquet(\"stock_trades.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e9668367-13f8-4f36-b59d-cb6a95c25eb4",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1435a91c-ca51-407a-ac0c-5d18cad2a877",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ceac36ab-fd4c-437e-b1a6-c7a3dcdda838",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
